style: round image for group #172
This file contains 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: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: false | |
description: The version to release | |
push: | |
branches: | |
- main | |
jobs: | |
flutter: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Download dependencies | |
run: flutter pub get | |
- name: Setup Supabase | |
uses: supabase/setup-cli@v1 | |
- name: Start Supabase local for tests | |
run: supabase start | |
- name: Run tests | |
run: | | |
supabase status -o json > supabase/config/localhost.json | |
flutter test | |
- name: Deploy to Supabase | |
run: | | |
supabase link --project-ref "$SUPABASE_PROJECT_ID" | |
supabase db push | |
env: | |
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} | |
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_PROD_DB_PASSWORD }} | |
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROD_PROJECT_ID }} | |
- name: Compare pubspec version and git tag | |
id: parse_pubspec | |
run: | | |
PUBSPEC_VERSION=$(grep -oP '^version:\s*\K[0-9]+\.[0-9]+\.[0-9]+' pubspec.yaml) | |
echo "Found version in pubspec.yaml: $PUBSPEC_VERSION" | |
echo "pubspec_version=$PUBSPEC_VERSION" >> $GITHUB_OUTPUT | |
# This step prepares a draft release with the release notes generated from the commit messages, | |
# and the tag name from the pubspec.yaml file. It will only update the release if it is a draft | |
# and has not been published yet. If the release is already published, it will not be updated and fail. | |
# Once a version is published to the app store, the release should be marked as published. | |
- name: Create or update draft release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: "v${{ steps.parse_pubspec.outputs.pubspec_version }}" | |
tag: "v${{ steps.parse_pubspec.outputs.pubspec_version }}" | |
generateReleaseNotes: true | |
makeLatest: true | |
draft: true | |
allowUpdates: true | |
updateOnlyUnreleased: true | |
- name: Configure git | |
run: | | |
git config --global user.name "GitHub Actions Bot" | |
git config --global user.email "[email protected]" | |
git fetch origin gh-pages:gh-pages | |
- name: Compile web and put in gh-pages branch | |
run: dart run peanut | |
- name: Push gh-pages | |
run: git push origin gh-pages | |
- name: Retrieve the Android keystore and key properties | |
env: | |
UPLOAD_KEYSTORE_B64: ${{ secrets.UPLOAD_KEYSTORE_B64 }} | |
KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} | |
run: | | |
echo "$UPLOAD_KEYSTORE_B64" | base64 --decode > android/keystore.jks | |
echo "$KEY_PROPERTIES" > android/key.properties | |
- name: Compile Android app | |
run: flutter build appbundle --build-number ${{ github.run_number }} | |
- name: Upload Android app to Play Store | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: is.giorgio.app.parousia | |
releaseFiles: build/app/outputs/bundle/release/app-release.aab | |
track: internal | |
status: completed | |
mappingFile: build/app/outputs/mapping/release/mapping.txt | |
debugSymbols: build/app/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib | |
- name: Upload to Sentry | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
# The +1 is explicitly provided for consistency with the Xcode Cloud build: since we set SENTRY_DIST below, | |
# Sentry will automatically pick that as build number anyway. | |
SENTRY_RELEASE: "is.giorgio.app.parousia@${{ steps.parse_pubspec.outputs.pubspec_version }}" | |
SENTRY_DIST: ${{ github.run_number }} | |
run: dart run sentry_dart_plugin |