Fix: purchase scan button (#423) #36
Workflow file for this run
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: Release mobile bundles | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*.*.*\+*' | |
jobs: | |
extract-version: | |
name: Determine version | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.get-version.outputs.tag }} | |
isAlpha: ${{ steps.get-version.outputs.isAlpha }} | |
versionCode: ${{ steps.get-version.outputs.versionCode }} | |
versionName: ${{ steps.get-version.outputs.versionName }} | |
steps: | |
- name: Determine version | |
id: get-version | |
run: | | |
tag=${GITHUB_REF#refs/*/} | |
[[ $tag == *'-alpha' ]] && isAlpha=true || isAlpha=false; | |
versionCode=${tag##*+} | |
versionCode=${versionCode%-*} | |
versionName=${tag%+*} | |
versionName=${versionName#v} | |
echo tag=$tag >> $GITHUB_OUTPUT | |
echo isAlpha=$isAlpha >> $GITHUB_OUTPUT | |
echo versionCode=$versionCode >> $GITHUB_OUTPUT | |
echo versionName=$versionName >> $GITHUB_OUTPUT | |
build: | |
name: Release Titan ${{ needs.extract-version.outputs.tag }} ${{ matrix.name }} | |
runs-on: macos-latest | |
needs: [extract-version] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: 'appbundle' | |
name: 'AAB' | |
path: build/app/outputs/bundle/*Release/app-*-release.aab | |
- target: 'ipa --no-codesign' | |
name: 'IPA' | |
path: build/ios/ipa/*.ipa | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
if: matrix.name == 'AAB' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17.x' | |
cache: 'gradle' | |
- name: Setup Flutter SDK | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.22.2' | |
cache: true | |
- name: Cleanup 🧹 | |
run: flutter clean | |
- name: Get Packages | |
run: flutter pub get | |
- name: Configure Alpha env | |
if: needs.extract-version.outputs.isAlpha == 'true' | |
run: | | |
echo ALPHA_HOST=$ALPHA_HOST >> .env | |
echo PLAUSIBLE_HOST=$PLAUSIBLE_HOST >> .env | |
echo PLAUSIBLE_DOMAIN=$PLAUSIBLE_DOMAIN >> .env | |
env: | |
ALPHA_HOST: ${{ vars.ALPHA_HOST }} | |
PLAUSIBLE_HOST: ${{ secrets.PLAUSIBLE_ALPHA_HOST }} | |
PLAUSIBLE_DOMAIN: ${{ secrets.PLAUSIBLE_ALPHA_DOMAIN }} | |
- name: Configure production env | |
if: needs.extract-version.outputs.isAlpha == 'false' | |
run: | | |
echo PROD_HOST=$PROD_HOST >> .env | |
echo PLAUSIBLE_HOST=$PLAUSIBLE_HOST >> .env | |
echo PLAUSIBLE_DOMAIN=$PLAUSIBLE_DOMAIN >> .env | |
env: | |
PROD_HOST: ${{ vars.PROD_HOST }} | |
PLAUSIBLE_HOST: ${{ secrets.PLAUSIBLE_HOST }} | |
PLAUSIBLE_DOMAIN: ${{ secrets.PLAUSIBLE_DOMAIN }} | |
- name: Add Firebase configuration for Alpha | |
if: needs.extract-version.outputs.isAlpha == 'true' | |
run: | | |
echo $GOOGLE_SERVICES_ALPHA_JSON_BASE64 | base64 -D -o android/app/src/alpha/google-services.json | |
echo $GOOGLE_SERVICE_INFO_ALPHA_PLIST_BASE64 | base64 -D -o ios/config/Alpha/GoogleService-Info.plist | |
env: | |
GOOGLE_SERVICES_ALPHA_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_ALPHA_JSON_BASE64 }} | |
GOOGLE_SERVICE_INFO_ALPHA_PLIST_BASE64: ${{ secrets.GOOGLE_SERVICE_INFO_ALPHA_PLIST_BASE64 }} | |
- name: Add Firebase configuration for production | |
if: needs.extract-version.outputs.isAlpha == 'false' | |
run: | | |
echo $GOOGLE_SERVICES_JSON_BASE64 | base64 -D -o android/app/src/prod/google-services.json | |
echo $GOOGLE_SERVICE_INFO_PLIST_BASE64 | base64 -D -o ios/config/Prod/GoogleService-Info.plist | |
env: | |
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} | |
GOOGLE_SERVICE_INFO_PLIST_BASE64: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST_BASE64 }} | |
- name: Create the Keystore | |
if: matrix.name == 'AAB' | |
run: | | |
echo $KEYSTORE_BASE64 | base64 -D -o $RUNNER_TEMP/myecl.keystore | |
echo storePassword=$STORE_PASSWORD >> android/key.properties | |
echo keyPassword=$KEY_PASSWORD >> android/key.properties | |
echo keyAlias=$KEY_ALIAS >> android/key.properties | |
echo storeFile=$RUNNER_TEMP/myecl.keystore >> android/key.properties | |
env: | |
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
- name: Build Alpha 🔧 | |
if: needs.extract-version.outputs.isAlpha == 'true' | |
run: flutter build ${{ matrix.target }} --flavor=alpha --release --build-name ${{ needs.extract-version.outputs.versionName }} --build-number ${{ needs.extract-version.outputs.versionCode }} | |
- name: Build production 🔧 | |
if: needs.extract-version.outputs.isAlpha == 'false' | |
run: flutter build ${{ matrix.target }} --flavor=prod --release --build-name ${{ needs.extract-version.outputs.versionName }} --build-number ${{ needs.extract-version.outputs.versionCode }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: titan-release | |
path: ${{ matrix.path }} | |
if-no-files-found: ignore |