Release Deployment #16
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: Deploy release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build-for-google-play: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| cache: gradle | |
| - name: Cache gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build bundle for Google Play release | |
| run: ./gradlew bundleRelease | |
| - name: Sign bundle for Google Play release | |
| uses: r0adkll/sign-android-release@v1 | |
| with: | |
| releaseDirectory: app/build/outputs/bundle/release | |
| signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
| alias: ${{ secrets.ALIAS }} | |
| keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
| keyPassword: ${{ secrets.KEY_PASSWORD }} | |
| - name: Upload bundle to Github release artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: google-play-bundle | |
| path: app/build/outputs/bundle/release/app-release.aab | |
| publish-built-file: | |
| needs: ["build-for-google-play"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download Google Play bundle from Github release artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: google-play-bundle | |
| path: . | |
| - name: Create service_account.json for Google Play release | |
| run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json | |
| - name: Publish bundle to Google Play | |
| uses: r0adkll/upload-google-play@v1 | |
| with: | |
| serviceAccountJson: service_account.json | |
| packageName: com.doubleangels.redact | |
| releaseFiles: app-release.aab | |
| track: production | |
| whatsNewDirectory: whatsnew | |
| delete-workflow-runs: | |
| needs: ["build-for-google-play", "publish-built-file"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Delete workflow runs | |
| uses: Mattraks/delete-workflow-runs@v2 | |
| with: | |
| token: ${{ github.token }} | |
| repository: ${{ github.repository }} | |
| retain_days: 30 | |
| keep_minimum_runs: 1 |