Skip to content

Commit

Permalink
Reusable build-all workflow, updated release github action
Browse files Browse the repository at this point in the history
  • Loading branch information
syt0r committed Mar 28, 2024
1 parent 20db385 commit 5a0bee8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 35 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build All

on: workflow_dispatch
on: [ workflow_call, workflow_dispatch ]

jobs:
build-android-and-desktop-linux:
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: android
path: app/build/outputs/fdroid/**/*.apk
path: app/build/outputs/apk/fdroid/release/*.apk
retention-days: 1

- name: Upload Desktop Build
Expand Down Expand Up @@ -65,14 +65,12 @@ jobs:
path: core/build/compose/jars/*.jar
retention-days: 1

publish:
verify-uploaded-builds:
needs: [ build-android-and-desktop-linux, build-desktop-windows ]
runs-on: ubuntu-latest
steps:
- name: Downloading artifacts
uses: actions/download-artifact@v4

- name: Create release
run: |
echo "TODO, create release here"
ls -R
- name: Print all files
run: ls -R
37 changes: 9 additions & 28 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,18 @@ on:
- "v*.*"

jobs:
Build:
build-all:
uses: ./.github/workflows/build-all.yml
secrets: inherit
create-release:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@v3
- name: Downloading artifacts
uses: actions/download-artifact@v4

- name: set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Prepare signing configuration
env:
KEYSTORE: ${{ secrets.KEYSTORE }}
run: echo $KEYSTORE | base64 --decode > keystore.jks

- name: Build
env:
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
SIGN_KEY: ${{ secrets.SIGN_KEY }}
SIGN_PASS: ${{ secrets.SIGN_PASS }}
run: |
./gradlew app:assembleFdroidRelease
echo "OUTPUT_FILE_PATH=$(find ~+ -name "*.apk" -print -quit)" >> $GITHUB_ENV
- name: Release
- name: Publish Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.OUTPUT_FILE_PATH }}
files: '**/*.@(jar|apk)'

0 comments on commit 5a0bee8

Please sign in to comment.