Android Build and Publish #5
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: Android Build and Publish | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Trigger on new tags (e.g., v1.0.0) | |
| workflow_dispatch: | |
| inputs: | |
| reason: | |
| description: Why did you trigger this workflow run manually? | |
| required: true | |
| default: Needing a new build. | |
| type: string | |
| tag: | |
| description: Which tag to build from? | |
| required: true | |
| default: v0.0.14 | |
| type: string | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Test | |
| run: ./gradlew clean check | |
| - name: Assemble all APKs | |
| run: ./gradlew createReleaseNotes build | |
| - name: Create GitHub release (with notes) | |
| id: create_release | |
| uses: comnoco/create-release-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ inputs.tag || github.ref }} | |
| release_name: Release ${{ github.ref_name }} | |
| body_path: .release-note.md | |
| - name: Upload Release APK | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./webview/build/outputs/apk/release/webview-release.apk | |
| asset_name: funke-wwwallet-${{ github.ref_name }}.apk | |
| asset_content_type: application/vnd.android.package-archive | |
| - name: Upload Debug APK | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./webview/build/outputs/apk/debug/webview-debug.apk | |
| asset_name: funke-wwwallet-debug-${{ github.ref_name }}.apk | |
| asset_content_type: application/vnd.android.package-archive | |
| - name: Upload Yubkit APK | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./webview/build/outputs/apk/yubikit/webview-yubikit.apk | |
| asset_name: funke-wwwallet-yubikit-${{ github.ref_name }}.apk | |
| asset_content_type: application/vnd.android.package-archive | |