chore: upgrade dependencies, clean warnings, and add POEditor transla… #4
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 Release APK | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v4 | |
| - name: Decode release keystore | |
| env: | |
| KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }} | |
| run: echo "$KEYSTORE_B64" | base64 -d > my-upload-key.jks | |
| - name: Build release APK | |
| env: | |
| STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: | | |
| chmod +x ./gradlew | |
| ./gradlew assembleRelease --no-daemon -Dorg.gradle.jvmargs="-Xmx2048m" -Dorg.gradle.workers.max=2 --warning-mode all | |
| - name: Extract version name | |
| id: version | |
| run: | | |
| version=$(sed -n 's/.*versionName = "\([^"]*\)".*/\1/p' app/build.gradle.kts) | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| - name: Rename release APK | |
| run: cp app/build/outputs/apk/release/app-release.apk "BoxViewer-${{ steps.version.outputs.version }}.apk" | |
| - name: Upload APK artifact for manual runs | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: BoxViewer-${{ steps.version.outputs.version }} | |
| path: BoxViewer-${{ steps.version.outputs.version }}.apk | |
| - name: Upload release APK to GitHub Releases | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| name: ${{ github.ref_name }} | |
| files: BoxViewer-${{ steps.version.outputs.version }}.apk | |
| generate_release_notes: true |