Last active
March 26, 2025 16:09
-
-
Save liubquanti/d4dd1fb62c14b5c5f9898b8ebeeef24d to your computer and use it in GitHub Desktop.
Auto build Flutter Android app after push and make release
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: Auto-Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-android: | |
| name: Android Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| architecture: x64 | |
| - run: flutter pub get | |
| - run: flutter build apk --release | |
| - name: Calculate Version | |
| id: version | |
| run: echo "VERSION=v$((${{ github.run_number }} / 10)).$((${{ github.run_number }} % 10))" >> $GITHUB_ENV | |
| - name: Upload Android APK to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: build/app/outputs/flutter-apk/app-release.apk | |
| tag: "${{ env.VERSION }}" | |
| overwrite: true | |
| body: "Реліз версії ${{ env.VERSION }} для ${{ github.repository }}." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment