Squashed commit of the following: #62
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: | |
build-debug: | |
name: Build debug | |
runs-on: ubuntu-latest | |
if: github.ref =='refs/heads/dev' | |
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/setup-ndk@v1.2.0 | |
with: | |
ndk-version: r25c | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- 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: | |
name: Build master | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
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/setup-ndk@v1.2.0 | |
with: | |
ndk-version: r25c | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- 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 | |