Skip to content

Release

Release #5

Workflow file for this run

name: Release
# Triggered automatically when you push a version tag (e.g. v1.2.3).
# Nothing needs to be done manually per-release — secrets are stored once
# and reused for every build.
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Version tag (e.g. v1.0.1)'
required: true
jobs:
build-android:
name: Build & publish Android AAB
runs-on: ubuntu-latest
permissions:
contents: write # needed to upload assets to the GitHub Release
steps:
- name: Checkout
uses: actions/checkout@v4
# ── Java ─────────────────────────────────────────────────────────────
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
# ── Flutter ──────────────────────────────────────────────────────────
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
# ── Firebase config ──────────────────────────────────────────────────
# Store the contents of google-services.json as a base64-encoded
# GitHub secret named GOOGLE_SERVICES_JSON.
# Encode it once on your machine with:
# base64 -i google-services.json | tr -d '\n'
# Then paste the result into Settings → Secrets → GOOGLE_SERVICES_JSON.
# You never need to touch this again unless you change Firebase projects.
- name: Write google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
if [ -z "$GOOGLE_SERVICES_JSON" ]; then
echo "::error::Secret GOOGLE_SERVICES_JSON is not set. Add it in Settings → Secrets."
exit 1
fi
echo "$GOOGLE_SERVICES_JSON" | base64 --decode \
> stop_at_67/android/app/google-services.json
# ── Signing ──────────────────────────────────────────────────────────
# Store the keystore as a base64-encoded secret named KEYSTORE_FILE.
# Store the key.properties contents as a secret named KEY_PROPERTIES.
# Encode the keystore once on your machine with:
# base64 -i your-release-key.jks | tr -d '\n'
#
# KEY_PROPERTIES must contain (use 'release.jks' for storeFile — the
# workflow writes the keystore to android/app/release.jks):
# storeFile=release.jks
# storePassword=<your store password>
# keyAlias=<your key alias>
# keyPassword=<your key password>
- name: Write keystore
env:
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
run: |
if [ -z "$KEYSTORE_FILE" ]; then
echo "::error::Secret KEYSTORE_FILE is not set. Add it in Settings → Secrets."
exit 1
fi
echo "$KEYSTORE_FILE" | base64 --decode \
> stop_at_67/android/app/release.jks
- name: Write key.properties
env:
KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }}
run: |
if [ -z "$KEY_PROPERTIES" ]; then
echo "::error::Secret KEY_PROPERTIES is not set. Add it in Settings → Secrets."
exit 1
fi
echo "$KEY_PROPERTIES" > stop_at_67/android/key.properties
# ── Build ────────────────────────────────────────────────────────────
- name: Install Flutter dependencies
working-directory: stop_at_67
run: flutter pub get
- name: Build release AAB
working-directory: stop_at_67
run: flutter build appbundle --release --dart-define=USE_TEST_ADS=false
# ── Publish ──────────────────────────────────────────────────────────
- name: Upload AAB to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: stop_at_67/build/app/outputs/bundle/release/app-release.aab