0.24.44 #86
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 APK | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: gradle | |
| - name: Prepare keystore | |
| run: | | |
| # Decode keystore | |
| echo "${{ secrets.RELEASE_KEYSTORE_BASE64 }}" | base64 --decode > app/keystore.jks | |
| - name: Build release APK | |
| run: sh gradlew assembleRelease --stacktrace | |
| env: | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| - name: Rename APK and Add Version Code Changelog | |
| run: | | |
| # Rename APK | |
| VERSION_NAME="$(jq -r ".elements[0].versionName" "app/build/outputs/apk/release/output-metadata.json")" | |
| echo "Version name: $VERSION_NAME" >> "$GITHUB_STEP_SUMMARY" | |
| echo '```json' >> "$GITHUB_STEP_SUMMARY" | |
| cat "app/build/outputs/apk/release/output-metadata.json" >> "$GITHUB_STEP_SUMMARY" | |
| echo >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| mv app/build/outputs/apk/release/*.apk "app/build/outputs/apk/release/WebviewKiosk_v$VERSION_NAME.apk" | |
| # Get version code from output-metadata.json | |
| VERSION_CODE=$(jq -r ".elements[0].versionCode" app/build/outputs/apk/release/output-metadata.json 2>/dev/null || echo "0") | |
| echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV | |
| # Ensure changelog exists | |
| if [[ ! -f "metadata/en-US/changelogs/${VERSION_CODE}.txt" ]]; then | |
| echo "Changelog not found for version $VERSION_CODE, creating empty file." | |
| touch metadata/en-US/changelogs/${VERSION_CODE}.txt | |
| fi | |
| - name: Create Draft GitHub Release | |
| id: create_release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| bodyFile: metadata/en-US/changelogs/${{ env.VERSION_CODE }}.txt | |
| artifacts: app/build/outputs/apk/release/*.apk | |
| draft: true |