Fix workflow to trigger on tag push #4
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: | |
| branches: | |
| - main | |
| - master | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| name: Build Split APKs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Create .env file | |
| run: | | |
| echo "RAPID_API_KEY='${{ secrets.RAPID_API_KEY }}'" > .env | |
| - name: Build split APKs | |
| run: flutter build apk --split-per-abi --release | |
| - name: Build universal APK | |
| run: flutter build apk --release | |
| - name: Upload ARM64 APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-arm64-v8a-release | |
| path: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
| - name: Upload ARMv7 APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-armeabi-v7a-release | |
| path: build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
| - name: Upload x86_64 APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-x86_64-release | |
| path: build/app/outputs/flutter-apk/app-x86_64-release.apk | |
| - name: Upload Universal APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release | |
| path: build/app/outputs/flutter-apk/app-release.apk | |
| - name: Create Release (on tag push) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
| build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
| build/app/outputs/flutter-apk/app-x86_64-release.apk | |
| build/app/outputs/flutter-apk/app-release.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |