hardening: secure android config and add tag-based APK release workflow #1
Workflow file for this run
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-android-apk | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-release-apk: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Generate native Android project | |
| env: | |
| EXPO_PUBLIC_SUPABASE_URL: ${{ secrets.EXPO_PUBLIC_SUPABASE_URL }} | |
| EXPO_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.EXPO_PUBLIC_SUPABASE_ANON_KEY }} | |
| run: npx expo prebuild --platform android --non-interactive | |
| - name: Build release APK | |
| working-directory: android | |
| run: ./gradlew assembleRelease | |
| - name: Upload APK as workflow artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release-apk | |
| path: android/app/build/outputs/apk/release/*.apk | |
| - name: Attach APK to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: android/app/build/outputs/apk/release/*.apk | |
| generate_release_notes: true |