Release 1.0.97 #93
Workflow file for this run
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 and Deploy | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| env: | |
| PUB_SUMMARY_ONLY: true | |
| KOTLIN_VERSION: "2.1.0" | |
| jobs: | |
| get-version-info: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| build_number: ${{ steps.version.outputs.build_number }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get version from tag | |
| id: version | |
| run: | | |
| version=${GITHUB_REF#refs/tags/} | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| echo "Release version: $version" | |
| BUILD_NUMBER=$(grep '^version:' pubspec.yaml | sed 's/.*+//') | |
| BUILD_NUMBER=$((BUILD_NUMBER * 10 + 3)) | |
| echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT | |
| build-android: | |
| needs: [get-version-info] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter from submodule | |
| run: | | |
| git submodule update --init --recursive flutter | |
| echo "${{ github.workspace }}/flutter/bin" >> $GITHUB_PATH | |
| flutter/bin/flutter config --no-analytics | |
| - name: Get Flutter dependencies | |
| run: flutter pub get | |
| - name: Decode Android keystore | |
| run: | | |
| echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > android/app/keystore.jks | |
| - name: Build android | |
| run: | | |
| echo "storePassword=${{ secrets.ANDROID_STORE_PASSWORD }}" > android/key.properties | |
| echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> android/key.properties | |
| echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties | |
| echo "storeFile=keystore.jks" >> android/key.properties | |
| flutter build appbundle | |
| flutter build apk --split-per-abi | |
| - name: Upload Android artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-builds | |
| path: | | |
| build/app/outputs/flutter-apk/app-*-release.apk | |
| build/app/outputs/bundle/release/app-release.aab | |
| build-linux: | |
| needs: [get-version-info] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter from submodule | |
| run: | | |
| git submodule update --init --recursive flutter | |
| echo "${{ github.workspace }}/flutter/bin" >> $GITHUB_PATH | |
| flutter/bin/flutter config --no-analytics | |
| - name: Get Flutter dependencies | |
| run: flutter pub get | |
| - 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 libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | |
| - name: Build Linux | |
| run: flutter build linux | |
| - name: Create Linux zip | |
| run: | | |
| cd build/linux/x64/release/bundle | |
| zip -r quitter-linux.zip . | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-builds | |
| path: build/linux/x64/release/bundle/quitter-linux.zip | |
| build-windows: | |
| needs: [get-version-info] | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter from submodule | |
| run: | | |
| git submodule update --init --recursive flutter | |
| echo "${{ github.workspace }}\flutter\bin" >> $env:GITHUB_PATH | |
| flutter\bin\flutter config --no-analytics | |
| - name: Get Flutter dependencies | |
| run: flutter pub get | |
| - name: Build Windows | |
| run: flutter build windows | |
| - name: Create Windows zip | |
| run: | | |
| Compress-Archive -Path ./build/windows/x64/runner/Release/* -DestinationPath ./quitter-windows.zip | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-builds | |
| path: | | |
| quitter-windows.zip | |
| build-and-deploy-web: | |
| needs: [get-version-info] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter from submodule | |
| run: | | |
| git submodule update --init --recursive flutter | |
| echo "${{ github.workspace }}/flutter/bin" >> $GITHUB_PATH | |
| flutter/bin/flutter config --no-analytics | |
| - name: Get Flutter dependencies | |
| run: flutter pub get | |
| - name: Enable web support | |
| run: flutter config --enable-web | |
| - name: Build Flutter web | |
| run: | | |
| flutter build web --release --base-href /${{ github.event.repository.name }}/ | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload to GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./build/web | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| create-github-release: | |
| needs: [get-version-info, build-android, build-linux, build-windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ needs.get-version-info.outputs.version }} | |
| name: ${{ needs.get-version-info.outputs.version }} | |
| body_path: fastlane/metadata/android/en-US/changelogs/${{ needs.get-version-info.outputs.build_number }}.txt | |
| files: | | |
| android-builds/flutter-apk/app-*-release.apk | |
| linux-builds/quitter-linux.zip | |
| windows-builds/quitter-windows.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| deploy-windows-store: | |
| needs: [get-version-info, build-windows] | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter from submodule | |
| run: | | |
| git submodule update --init --recursive flutter | |
| echo "${{ github.workspace }}\flutter\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| flutter\bin\flutter config --no-analytics | |
| - name: Get Flutter dependencies | |
| run: flutter pub get | |
| - name: Build MSIX | |
| run: flutter pub run msix:create | |
| - name: Setup .NET 9.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: Setup Microsoft Store CLI | |
| uses: microsoft/setup-msstore-cli@v1 | |
| - name: Configure Microsoft Store CLI | |
| run: | | |
| msstore reconfigure --tenantId ${{ secrets.AZURE_TENANT_ID }} --clientId ${{ secrets.AZURE_CLIENT_ID }} --clientSecret ${{ secrets.AZURE_CLIENT_SECRET }} --sellerId ${{ secrets.MSSTORE_SELLER_ID }} | |
| - name: Publish to Microsoft Store | |
| run: | | |
| msstore publish --inputDirectory build/windows/x64/runner/Release --appId 9PKVZWDG3FGC --packageRolloutPercentage 100 | |
| - name: Azure CLI Login | |
| run: | | |
| az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }} --allow-no-subscriptions | |
| - name: Get Pending Submission | |
| id: get_submission | |
| run: | | |
| $token = (az account get-access-token --resource https://manage.devcenter.microsoft.com --query accessToken -o tsv) | |
| $headers = @{Authorization = "Bearer $token"} | |
| $app = Invoke-RestMethod -Uri "https://manage.devcenter.microsoft.com/v1.0/my/applications/9PKVZWDG3FGC" -Headers $headers | |
| $submissionId = $app.pendingApplicationSubmission.id | |
| echo "SUBMISSION_ID=$submissionId" >> $env:GITHUB_ENV | |
| - name: Finalize Package Rollout | |
| run: | | |
| $token = (az account get-access-token --resource https://manage.devcenter.microsoft.com --query accessToken -o tsv) | |
| $headers = @{ | |
| Authorization = "Bearer $token" | |
| "Content-Type" = "application/json" | |
| } | |
| Invoke-RestMethod -Method Post -Uri "https://manage.devcenter.microsoft.com/v1.0/my/applications/9PKVZWDG3FGC/submissions/$env:SUBMISSION_ID/finalizepackagerollout" -Headers $headers -Body "{}" | |
| deploy-google-play: | |
| needs: [get-version-info, build-android] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download Android artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: android-builds | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true | |
| - name: Create Google Play JSON key file | |
| run: | | |
| echo '${{ secrets.GOOGLE_PLAY_JSON_KEY }}' > google-play-key.json | |
| - name: Deploy to Google Play | |
| run: | | |
| bundle exec fastlane supply \ | |
| --aab bundle/release/app-release.aab \ | |
| --json_key google-play-key.json \ | |
| --package_name com.quitter.app \ | |
| --track production | |