fix flutter analyse #11
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: Flutter Build & Release | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| flutter-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| flutter-version: ['3.38.9'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ matrix.flutter-version }} | |
| channel: stable | |
| cache: true | |
| - name: Show Flutter version | |
| run: flutter --version | |
| - name: Check prod config exists | |
| run: test -f config/prod.json | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Run Flutter Analyze | |
| run: flutter analyze | |
| - name: Run Flutter Format Check | |
| run: dart format --set-exit-if-changed . | |
| continue-on-error: true | |
| - name: Build Web Production | |
| run: flutter build web --release --dart-define-from-file=config/prod.json | |
| - name: Zip Web Build | |
| run: | | |
| cd build/web | |
| zip -r ../../tablemaster-web-prod.zip . | |
| - name: Build APK Production | |
| run: flutter build apk --release --dart-define-from-file=config/prod.json | |
| - name: Rename APK | |
| run: | | |
| cp build/app/outputs/flutter-apk/app-release.apk tablemaster-prod.apk | |
| - name: Upload workflow artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: flutter-builds | |
| path: | | |
| tablemaster-prod.apk | |
| tablemaster-web-prod.zip | |
| - name: Create GitHub Release | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="flutter-prod-${{ github.run_number }}" | |
| TITLE="TableMaster Flutter Prod #${{ github.run_number }}" | |
| gh release create "$TAG" \ | |
| tablemaster-prod.apk \ | |
| tablemaster-web-prod.zip \ | |
| --title "$TITLE" \ | |
| --notes "Build Flutter production depuis main. | |
| Commit: ${{ github.sha }} | |
| Fichiers: | |
| - tablemaster-prod.apk | |
| - tablemaster-web-prod.zip" \ | |
| --latest |