chore: release 1.11.1 #100
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 | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| # Cancel in-progress runs for the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| FLUTTER_VERSION: '3.x' | |
| jobs: | |
| # Shared setup job - generates code and caches it | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cache-key: ${{ steps.cache-key.outputs.key }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Generate cache key | |
| id: cache-key | |
| run: echo "key=generated-${{ hashFiles('pubspec.lock', 'lib/**/*.dart') }}" >> $GITHUB_OUTPUT | |
| - name: Cache generated code | |
| id: cache-generated | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| lib/**/*.g.dart | |
| lib/**/*.freezed.dart | |
| key: ${{ steps.cache-key.outputs.key }} | |
| - name: Setup Flutter | |
| if: steps.cache-generated.outputs.cache-hit != 'true' | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: 'stable' | |
| cache: true | |
| - name: Cache pub dependencies | |
| if: steps.cache-generated.outputs.cache-hit != 'true' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| .dart_tool | |
| key: pub-${{ hashFiles('pubspec.lock') }} | |
| restore-keys: pub- | |
| - name: Install dependencies | |
| if: steps.cache-generated.outputs.cache-hit != 'true' | |
| run: flutter pub get | |
| - name: Generate code | |
| if: steps.cache-generated.outputs.cache-hit != 'true' | |
| run: dart run build_runner build --delete-conflicting-outputs | |
| - name: Upload generated code | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: generated-code | |
| path: | | |
| lib/**/*.g.dart | |
| lib/**/*.freezed.dart | |
| retention-days: 1 | |
| build-web: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download generated code | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: generated-code | |
| path: lib/ | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: 'stable' | |
| cache: true | |
| - name: Cache pub dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| .dart_tool | |
| key: pub-${{ hashFiles('pubspec.lock') }} | |
| restore-keys: pub- | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build web | |
| run: flutter build web --release | |
| - name: Deploy to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy build/web --project-name=dash-for-cf | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| build-android: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download generated code | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: generated-code | |
| path: lib/ | |
| - name: Setup Android signing | |
| env: | |
| KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
| STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| run: | | |
| if [ -n "$KEYSTORE_BASE64" ]; then | |
| echo "$KEYSTORE_BASE64" | base64 --decode > android/app/upload-keystore.jks | |
| { | |
| echo "storePassword=$STORE_PASSWORD" | |
| echo "keyPassword=$KEY_PASSWORD" | |
| echo "keyAlias=$KEY_ALIAS" | |
| echo "storeFile=upload-keystore.jks" | |
| } > android/key.properties | |
| else | |
| echo "Signing secrets not configured. Building unsigned artifact." | |
| fi | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: 'stable' | |
| cache: true | |
| - name: Cache pub dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| .dart_tool | |
| key: pub-${{ hashFiles('pubspec.lock') }} | |
| restore-keys: pub- | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ hashFiles('android/gradle/wrapper/gradle-wrapper.properties', 'android/build.gradle', 'android/app/build.gradle') }} | |
| restore-keys: gradle- | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build APK (arm64 only) | |
| run: flutter build apk --release --target-platform android-arm64 | |
| - name: Rename APK | |
| run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/dash-for-cf.apk | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk-arm64 | |
| path: build/app/outputs/flutter-apk/dash-for-cf.apk | |
| retention-days: 7 | |
| build-linux: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download generated code | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: generated-code | |
| path: lib/ | |
| - name: Cache apt packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: /var/cache/apt/archives | |
| key: apt-linux-${{ runner.os }} | |
| restore-keys: apt-linux- | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libsecret-1-dev libjsoncpp-dev libayatana-appindicator3-dev | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: 'stable' | |
| cache: true | |
| - name: Cache pub dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| .dart_tool | |
| key: pub-${{ hashFiles('pubspec.lock') }} | |
| restore-keys: pub- | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build Linux | |
| run: flutter build linux --release | |
| - name: Package Linux build | |
| run: | | |
| cd build/linux/x64/release/bundle | |
| tar -czvf ../../../../../dash-for-cf-linux.tar.gz . | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-build | |
| path: dash-for-cf-linux.tar.gz | |
| retention-days: 7 | |
| build-macos: | |
| needs: setup | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download generated code | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: generated-code | |
| path: lib/ | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: 'stable' | |
| cache: true | |
| - name: Cache pub dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| .dart_tool | |
| key: pub-macos-${{ hashFiles('pubspec.lock') }} | |
| restore-keys: pub-macos- | |
| - name: Cache CocoaPods | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| macos/Pods | |
| ~/.cocoapods | |
| key: cocoapods-macos-${{ hashFiles('macos/Podfile.lock') }} | |
| restore-keys: cocoapods-macos- | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build macOS | |
| run: flutter build macos --release | |
| - name: Package macOS build | |
| run: | | |
| cd build/macos/Build/Products/Release | |
| zip -r ../../../../../dash-for-cf-macos.zip *.app | |
| - name: Upload macOS artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-build | |
| path: dash-for-cf-macos.zip | |
| retention-days: 7 |