prevents negative time #19
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: CI & Release | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| release: | |
| types: [created] | |
| jobs: | |
| # CI job - runs on push/PR to main | |
| ci: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.35.7' | |
| channel: 'stable' | |
| - name: Cache Flutter dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-flutter- | |
| - name: Flutter doctor | |
| run: flutter doctor | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Generate l10n | |
| run: flutter gen-l10n | |
| - name: Run tests | |
| run: flutter test | |
| - name: Build debug APK | |
| run: flutter build apk --debug | |
| - name: Build debug appbundle | |
| run: flutter build appbundle --debug | |
| # Release job - runs only on release creation | |
| release: | |
| name: Build Release APK | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.35.7' | |
| channel: 'stable' | |
| - name: Cache Flutter dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-flutter- | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Generate l10n | |
| run: flutter gen-l10n | |
| - name: Build release APK | |
| run: flutter build apk --release | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release.apk | |
| path: build/app/outputs/flutter-apk/app-release.apk | |