Skip to content

Bump version to 1.4.1 #82

Bump version to 1.4.1

Bump version to 1.4.1 #82

Workflow file for this run

name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
ci:
uses: ./.github/workflows/ci.yml
build-apk:
needs: [ci]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter pub get
- name: Verify version matches tag
run: |
TAG="${GITHUB_REF#refs/tags/v}"
PUBSPEC_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | sed 's/+.*//')
if [ "$TAG" != "$PUBSPEC_VERSION" ]; then
echo "ERROR: Tag v$TAG does not match pubspec.yaml version $PUBSPEC_VERSION"
exit 1
fi
# Signing: Android requires a consistent keystore across releases.
# Without this, each CI run generates a random debug key, causing
# "app not installed" errors when updating (signature mismatch).
# The keystore is stored as a base64-encoded GitHub secret.
- name: Decode keystore
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/upload-keystore.jks
- name: Create key.properties
run: |
cat > android/key.properties << EOF
storePassword=${{ secrets.KEYSTORE_PASSWORD }}
keyPassword=${{ secrets.KEYSTORE_PASSWORD }}
keyAlias=upload
storeFile=../upload-keystore.jks
EOF
# Debug symbols: Release builds use --obfuscate to shrink the binary,
# which makes crash stacks unreadable (just hex addresses). The
# --split-debug-info flag extracts the symbol mapping into separate
# files so we can reverse the obfuscation later. We zip these and
# attach them to the GitHub release. To symbolicate a crash:
# unzip debug-symbols.zip -d symbols/
# flutter symbolize -i stacktrace.txt -d symbols/
- name: Build APK
run: |
FIREBASE_PROJECT_ID=$(jq -r '.project_info.project_id' android/app/google-services.json)
FIREBASE_API_KEY=$(jq -r '.client[0].api_key[0].current_key' android/app/google-services.json)
flutter build apk --release \
--split-debug-info=build/app/outputs/symbols \
--obfuscate \
--dart-define=FIREBASE_API_KEY=$FIREBASE_API_KEY \
--dart-define=FIREBASE_PROJECT_ID=$FIREBASE_PROJECT_ID
- name: Zip debug symbols
run: cd build/app/outputs/symbols && zip -r ../../../../debug-symbols.zip .
- name: Rename APK
run: |
TAG="${GITHUB_REF#refs/tags/v}"
mv build/app/outputs/flutter-apk/app-release.apk \
build/app/outputs/flutter-apk/TaskRoulette-${TAG}.apk
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
build/app/outputs/flutter-apk/TaskRoulette-*.apk
debug-symbols.zip
generate_release_notes: true
deploy-web:
needs: [ci]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter pub get
- run: dart run sqflite_common_ffi_web:setup
- name: Build web
run: |
FIREBASE_API_KEY=$(jq -r '.client[0].api_key[0].current_key' android/app/google-services.json)
FIREBASE_PROJECT_ID=$(jq -r '.project_info.project_id' android/app/google-services.json)
flutter build web --release --base-href /task-roulette/ \
--dart-define=FIREBASE_API_KEY=$FIREBASE_API_KEY \
--dart-define=FIREBASE_PROJECT_ID=$FIREBASE_PROJECT_ID
- uses: actions/upload-pages-artifact@v4
with:
path: build/web
- id: deployment
uses: actions/deploy-pages@v4