Manual Build (No Upload) #2
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: Manual Build (No Upload) | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build-only: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '21' | |
| cache: 'gradle' | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.0' | |
| - name: Install Fastlane | |
| run: gem install fastlane | |
| # --- SECRET DECODING (Required for Play Store Version Check & Signing) --- | |
| - name: Decode Keystore | |
| env: | |
| ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
| run: echo "$ANDROID_KEYSTORE_BASE64" | base64 --decode > app/release.jks | |
| - name: Decode Google Play Service Account | |
| env: | |
| PLAY_STORE_JSON_KEY: ${{ secrets.PLAY_STORE_JSON_KEY }} | |
| run: echo "$PLAY_STORE_JSON_KEY" > app/google-play-api.json | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| # --- FASTLANE --- | |
| - name: Run Fastlane (Build Candidates) | |
| env: | |
| JSON_KEY_FILE: ${{ github.workspace }}/app/google-play-api.json | |
| SUPPLY_JSON_KEY: ${{ github.workspace }}/app/google-play-api.json | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEYSTORE_FILE_PATH: ${{ github.workspace }}/app/release.jks | |
| run: fastlane android build_release_candidates | |
| # --- ARTIFACT UPLOAD --- | |
| - name: Read Version Info | |
| id: version_info | |
| run: | | |
| echo "VERSION_NAME=$(cat version_name.txt)" >> $GITHUB_ENV | |
| echo "VERSION_CODE=$(cat version_code.txt)" >> $GITHUB_ENV | |
| - name: Upload APKs to GitHub Actions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Thor-v${{ env.VERSION_NAME }}-Build-${{ env.VERSION_CODE }} | |
| path: | | |
| app/build/distribution/foss/foss-release.apk | |
| app/build/distribution/store/store-release.apk | |
| # --- SECURITY CLEANUP --- | |
| - name: Cleanup sensitive files | |
| if: always() | |
| run: | | |
| rm -f app/release.jks | |
| rm -f app/google-play-api.json |