trying cicd #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: Flutter Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| build: | |
| name: Build Apps | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for proper versioning | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.29.2' | |
| channel: 'stable' | |
| cache: true | |
| - name: Debug repository contents | |
| run: | | |
| pwd | |
| ls -la | |
| cat melos.yaml | |
| - name: Install Melos | |
| run: | | |
| dart pub global activate melos | |
| echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH | |
| echo "PATH=$PATH:$HOME/.pub-cache/bin" >> $GITHUB_ENV | |
| - name: Bootstrap Melos (initialize workspace) | |
| run: | | |
| melos --version | |
| melos bootstrap | |
| shell: bash | |
| - name: Run analyze | |
| run: melos run analyze | |
| continue-on-error: true # Continue even if analysis fails | |
| - name: Build Web App | |
| run: melos run build:web | |
| continue-on-error: true # Continue even if web build fails | |
| - name: Upload Web Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: web-build | |
| path: packages/web_app/build/web | |
| retention-days: 7 | |
| if: success() || failure() # Upload even if previous step failed | |
| - name: Build Android APK | |
| run: melos run build:apk | |
| continue-on-error: true # Continue even if Android build fails | |
| - name: Upload Android APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: packages/mobile_app/build/app/outputs/flutter-apk/app-release.apk | |
| retention-days: 7 | |
| if: success() || failure() # Upload even if previous step failed |