Separate debug and release build for dev and master branch, sign buil… #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android Build | ||
on: | ||
push: | ||
branches: | ||
- master # Change this to your main branch name (e.g., master) | ||
- dev | ||
jobs: | ||
setup: | ||
name: Setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: '17' # Change this to the required Java version for your Android project | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: 7.4.2 | ||
- name: Setup Android NDK | ||
uses: nttld/[email protected] | ||
with: | ||
ndk-version: r25c | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
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: RECORDA-debug # Change this to your desired artifact name | ||
path: ./app/build/outputs/apk/debug/*.apk | ||
build-master: | ||
Check failure on line 50 in .github/workflows/android_build.yml GitHub Actions / Android BuildInvalid workflow file
|
||
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 | ||