Skip to content

Commit

Permalink
Separate debug and release build for dev and master branch, sign buil…
Browse files Browse the repository at this point in the history
…ds on master branch
  • Loading branch information
pmaanen committed Dec 11, 2023
1 parent 6e81a5b commit 7ffc68c
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- master # Change this to your main branch name (e.g., master)
- dev
jobs:
build:
setup:
name: Setup
runs-on: ubuntu-latest

steps:
Expand All @@ -32,11 +33,40 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Build APK
run: ./gradlew assembleDebug # Change 'assembleDebug' to 'assembleRelease' if you want a release build

build-debug:
name: Build debug
needs: [setup]
if: github.ref =='refs/heads/dev'
steps:
- name: Build debug APK
run: ./gradlew assembleDebug
- name: Upload APK artifact
uses: actions/upload-artifact@v2
with:
name: app-debug # Change this to your desired artifact name
path: ./app/build/outputs/apk/debug/LSLRecorder-1.0.0-debug.apk
name: RECORDA-debug # Change this to your desired artifact name
path: ./app/build/outputs/apk/debug/*.apk

build-master:
name: Build master
needs: [setup]
if: github.ref == 'refs/heads/master'
steps:
- name: Build debug APK
run: ./gradlew assembleRelease
- name: Sign app APK
uses: r0adkll/sign-android-release@v1
# ID used to access action output
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Upload APK artifact
uses: actions/upload-artifact@v2
with:
name: RECORDA-release # Change this to your desired artifact name
path: ${{steps.sign_app.outputs.signedReleaseFile}} # Change the path to the location of your APK file

0 comments on commit 7ffc68c

Please sign in to comment.