fix: sign the release APK in Gradle instead of the signing action #3
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: Build and publish APK | |
| # Runs when you push a version tag like v1.0.0-beta, or when triggered by hand. | |
| # It builds the release APK, signs it (if signing secrets are set), and attaches | |
| # it to the matching GitHub Release so people can download and sideload it. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| # Gradle signs the release APK directly using the keystore from secrets, so | |
| # there's no dependency on a specific build-tools version being preinstalled. | |
| # Set the four secrets under Settings > Secrets and variables > Actions. | |
| - name: Build signed release APK | |
| env: | |
| KEYSTORE_FILE: ${{ runner.temp }}/keystore.jks | |
| KEYSTORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: | | |
| echo "${{ secrets.SIGNING_KEY }}" | base64 -d > "$KEYSTORE_FILE" | |
| chmod +x ./gradlew | |
| ./gradlew :app:assembleRelease --no-daemon | |
| - name: Collect APK | |
| run: | | |
| mkdir -p out | |
| cp app/build/outputs/apk/release/app-release.apk "out/FocusForcePlus-${{ github.ref_name }}.apk" | |
| - name: Publish to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: out/*.apk | |
| draft: false | |
| prerelease: true | |
| generate_release_notes: true |