Merge pull request #1 from MaimoryLab/feat/file-download-preview #6
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 Android APK | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-java@v6 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| - name: Build APK | |
| run: | | |
| args=() | |
| if [[ "$GITHUB_REF" == refs/tags/v* ]]; then | |
| args+=(--build-name "${GITHUB_REF_NAME#v}" --build-number "$GITHUB_RUN_NUMBER") | |
| fi | |
| flutter build apk --target-platform android-arm64 --release "${args[@]}" | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: codeoff-android-arm64 | |
| path: build/app/outputs/flutter-apk/app-release.apk | |
| if-no-files-found: error | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: codeoff-android-arm64 | |
| - name: Upload APK to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| gh release create "$GITHUB_REF_NAME" app-release.apk --title "$GITHUB_REF_NAME" --generate-notes |