|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout repo |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + submodules: true |
| 18 | + |
| 19 | + - name: Set up Android NDK |
| 20 | + uses: nttld/setup-ndk@v1 |
| 21 | + with: |
| 22 | + ndk-version: r28b |
| 23 | + |
| 24 | + - name: Build proot |
| 25 | + run: | |
| 26 | + thirdparty/proot/build.sh |
| 27 | +
|
| 28 | + - name: Set up JDK |
| 29 | + uses: actions/setup-java@v4 |
| 30 | + with: |
| 31 | + java-version: 17 |
| 32 | + distribution: temurin |
| 33 | + |
| 34 | + - name: Build debug APK |
| 35 | + run: | |
| 36 | + ./gradlew assembleDebug |
| 37 | +
|
| 38 | + - name: Decode keystore |
| 39 | + run: | |
| 40 | + echo "${{ secrets.KEYSTORE }}" | base64 -d > /tmp/release.keystore |
| 41 | +
|
| 42 | + - name: Build release APK |
| 43 | + if: github.ref == 'refs/heads/main' |
| 44 | + env: |
| 45 | + GABE_RELEASE_KEYSTORE_FILE: /tmp/release.keystore |
| 46 | + GABE_RELEASE_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} |
| 47 | + GABE_RELEASE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} |
| 48 | + GABE_RELEASE_KEY_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} |
| 49 | + run: | |
| 50 | + ./gradlew assembleRelease |
| 51 | +
|
| 52 | + - name: Build release AAB |
| 53 | + if: github.ref == 'refs/heads/main' |
| 54 | + env: |
| 55 | + GABE_RELEASE_KEYSTORE_FILE: /tmp/release.keystore |
| 56 | + GABE_RELEASE_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} |
| 57 | + GABE_RELEASE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} |
| 58 | + GABE_RELEASE_KEY_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} |
| 59 | + run: | |
| 60 | + ./gradlew bundleRelease |
| 61 | +
|
| 62 | + - name: Upload debug artifacts |
| 63 | + uses: actions/upload-artifact@v4 |
| 64 | + with: |
| 65 | + name: debug-artifacts |
| 66 | + path: | |
| 67 | + app/build/outputs/apk/debug/ |
| 68 | +
|
| 69 | + - name: Upload release artifacts |
| 70 | + if: github.ref == 'refs/heads/main' |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + with: |
| 73 | + name: release-artifacts |
| 74 | + path: | |
| 75 | + app/build/outputs/apk/release/ |
| 76 | + app/build/outputs/bundle/release/ |
0 commit comments