fix(ci): calculate Android build number in shell #1104
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: Check Auto Generated Files | |
| on: | |
| push: | |
| branches: [ 'main' ] | |
| pull_request: | |
| concurrency: | |
| group: generated-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| # Define permissions for the GITHUB_TOKEN | |
| permissions: | |
| contents: read # Only read access to repository contents | |
| pull-requests: read # Only read access to pull requests | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Retrieve Flutter version from FVM config | |
| uses: kuhnroyal/flutter-fvm-config-action@v1 | |
| - name: Setup Flutter SDK | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: ${{ env.FLUTTER_CHANNEL }} | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Setup Firebase Options | |
| run: | | |
| tee lib/firebase_options.dart <<EOF | |
| class DefaultFirebaseOptions { | |
| static const currentPlatform = null; | |
| } | |
| EOF | |
| - name: Check if generated files are up to date | |
| run: | | |
| flutter pub run build_runner build --delete-conflicting-outputs | |
| CHANGED_FILES=$(git diff --name-only | wc -l) | |
| if [[ $CHANGED_FILES -gt 0 ]]; then | |
| echo " | |
| ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗ | |
| ║ ║ | |
| ║ Generated files are not up to date. ║ | |
| ║ Please run 'flutter pub run build_runner build --delete-conflicting-outputs' locally and commit the changes. ║ | |
| ║ ║ | |
| ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝ | |
| " | |
| exit 1 | |
| fi |