Merge pull request #91 from Panacota96/codex/update-readme-role-first… #105
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: Android Release | ||
|
Check failure on line 1 in .github/workflows/android-release.yml
|
||
| on: | ||
| push: | ||
| branches: | ||
| - release/mobile | ||
| workflow_dispatch: | ||
| inputs: | ||
| track: | ||
| description: Google Play track to publish | ||
| required: true | ||
| default: internal | ||
| type: choice | ||
| options: | ||
| - internal | ||
| - closed | ||
| - production | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: android-release | ||
| cancel-in-progress: false | ||
| env: | ||
| PACKAGE_NAME: com.panacota96.loupgarous | ||
| jobs: | ||
| build-release: | ||
| name: Android Release Bundle | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| release_version: ${{ steps.release_meta.outputs.release_version }} | ||
| android_version_name: ${{ steps.release_meta.outputs.android_version_name }} | ||
| android_version_code: ${{ steps.release_meta.outputs.android_version_code }} | ||
| release_notes_file: ${{ steps.release_meta.outputs.release_notes_file }} | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| - name: Set up Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: 21 | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Compute release metadata | ||
| id: release_meta | ||
| run: node scripts/release/compute-release-metadata.mjs | ||
| - name: Decode Android keystore | ||
| if: ${{ secrets.ANDROID_KEYSTORE_BASE64 != '' }} | ||
| env: | ||
| ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | ||
| run: | | ||
| printf '%s' "$ANDROID_KEYSTORE_BASE64" | base64 --decode > android/release.keystore | ||
| - name: Sync Capacitor Android assets | ||
| run: npm run cap:sync | ||
| - name: Ensure Gradle wrapper is executable | ||
| run: chmod +x android/gradlew | ||
| - name: Build release AAB | ||
| working-directory: android | ||
| env: | ||
| ANDROID_VERSION_NAME: ${{ steps.release_meta.outputs.android_version_name }} | ||
| ANDROID_VERSION_CODE: ${{ steps.release_meta.outputs.android_version_code }} | ||
| ANDROID_KEYSTORE_PATH: ${{ github.workspace }}/android/release.keystore | ||
| ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }} | ||
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | ||
| ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | ||
| run: ./gradlew bundleRelease --stacktrace | ||
| - name: Prepare Google Play release notes | ||
| run: | | ||
| mkdir -p distribution/whatsnew | ||
| cp "${{ steps.release_meta.outputs.release_notes_file }}" distribution/whatsnew/whatsnew-en-US | ||
| - name: Upload release bundle artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: android-release-bundle | ||
| path: | | ||
| android/app/build/outputs/bundle/release/app-release.aab | ||
| distribution/whatsnew/whatsnew-en-US | ||
| ${{ steps.release_meta.outputs.release_notes_file }} | ||
| publish-internal: | ||
| name: Publish Google Play Internal | ||
| runs-on: ubuntu-latest | ||
| needs: build-release | ||
| if: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON != '' && (github.event_name == 'push' || inputs.track == 'internal') }} | ||
| environment: android-internal | ||
| steps: | ||
| - name: Download release bundle | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: android-release-bundle | ||
| path: . | ||
| - name: Upload to Google Play internal track | ||
| uses: r0adkll/upload-google-play@v1 | ||
| with: | ||
| serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} | ||
| packageName: ${{ env.PACKAGE_NAME }} | ||
| releaseFiles: android/app/build/outputs/bundle/release/app-release.aab | ||
| track: internal | ||
| status: completed | ||
| changesNotSentForReview: true | ||
| whatsNewDirectory: distribution/whatsnew | ||
| promote-track: | ||
| name: Promote Google Play Track | ||
| runs-on: ubuntu-latest | ||
| needs: build-release | ||
| if: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON != '' && github.event_name == 'workflow_dispatch' && inputs.track != 'internal' }} | ||
| environment: android-production | ||
| steps: | ||
| - name: Download release bundle | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: android-release-bundle | ||
| path: . | ||
| - name: Upload to Google Play target track | ||
| uses: r0adkll/upload-google-play@v1 | ||
| with: | ||
| serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} | ||
| packageName: ${{ env.PACKAGE_NAME }} | ||
| releaseFiles: android/app/build/outputs/bundle/release/app-release.aab | ||
| track: ${{ inputs.track }} | ||
| status: completed | ||
| changesNotSentForReview: true | ||
| whatsNewDirectory: distribution/whatsnew | ||