refactor: reorganize installer structure and improve build script #37
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 Tests | |
| on: | |
| push: | |
| branches: [main, dev/main] | |
| pull_request: | |
| branches: [main, dev/main] | |
| workflow_dispatch: | |
| jobs: | |
| analyze: | |
| name: Analyze Code | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.38.5" | |
| channel: "stable" | |
| cache: true | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Analyze code | |
| run: flutter analyze | |
| build-android: | |
| name: Build Android APK | |
| runs-on: ubuntu-latest | |
| needs: analyze | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.38.5" | |
| channel: "stable" | |
| cache: true | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Build Android APK (debug) | |
| run: flutter build apk --debug --no-shrink | |
| build-web: | |
| name: Build Web | |
| runs-on: ubuntu-latest | |
| needs: analyze | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.38.5" | |
| channel: "stable" | |
| cache: true | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Build Web | |
| run: flutter build web --release --base-href "/" | |
| - name: Upload web build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: web-build | |
| path: build/web | |
| retention-days: 1 | |
| build-windows: | |
| name: Build Windows | |
| runs-on: windows-latest | |
| needs: analyze | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.38.5" | |
| channel: "stable" | |
| cache: true | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Build Windows | |
| run: flutter build windows --release | |
| status-check: | |
| name: All Builds Status | |
| runs-on: ubuntu-latest | |
| needs: [build-android, build-web, build-windows] | |
| if: always() | |
| steps: | |
| - name: Check build status | |
| run: | | |
| if [ "${{ needs.build-android.result }}" != "success" ] || \ | |
| [ "${{ needs.build-web.result }}" != "success" ] || \ | |
| [ "${{ needs.build-windows.result }}" != "success" ]; then | |
| echo "Some builds failed!" | |
| exit 1 | |
| else | |
| echo "All builds passed!" | |
| fi |