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 env: # Every current trigger path produces an installable APK artifact, so ship the analytics-enabled build consistently. VITE_ENABLE_POSTHOG: 'true' 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 }}