Release Pocket (Android) #4
This file contains hidden or 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: Release Pocket (Android) | |
| permissions: | |
| contents: write | |
| actions: read | |
| on: | |
| release: | |
| types: | |
| - prereleased | |
| workflow_dispatch: | |
| inputs: | |
| build_only: | |
| description: Build only (no upload to release) | |
| required: false | |
| default: false | |
| type: boolean | |
| schedule: | |
| - cron: '0 1 * * *' | |
| jobs: | |
| build: | |
| # TODO: build release APK | |
| name: Build Debuggable Android APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build:packages | |
| - name: Build web assets | |
| run: pnpm -F @proj-airi/stage-pocket run build | |
| - name: Capacitor sync | |
| run: pnpm -F @proj-airi/stage-pocket exec cap sync android | |
| - name: Build debug APK | |
| working-directory: apps/stage-pocket/android | |
| run: ./gradlew assembleDebug | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: airi-pocket-android-debug | |
| path: apps/stage-pocket/android/app/build/outputs/apk/debug/app-debug.apk | |
| if-no-files-found: error | |
| - name: Upload to GitHub Releases | |
| if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.build_only) }} | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: apps/stage-pocket/android/app/build/outputs/apk/debug/app-debug.apk | |
| append_body: true | |
| tag_name: ${{ github.event.release.tag_name }} |