1.0.76 #72
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: Build for Android | |
on: | |
release: | |
types: [prereleased] | |
jobs: | |
build: | |
name: Build APK | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
# Navigate to the submodule and perform the necessary git operations | |
- name: Update flutter submodule to stable branch | |
run: | | |
git submodule update --init --recursive | |
cd submodules/flutter | |
git reset --merge | |
git checkout stable | |
git pull origin stable | |
cd ../.. | |
- run: submodules/flutter/bin/flutter pub get | |
- name: Run Flutter tests | |
run: submodules/flutter/bin/flutter test | |
- name: Set up signing config | |
run: | | |
echo "${{ secrets.ANDROID_KEY_BASE64 }}" | base64 -d - > upload-keystore.jks | |
echo "${{ secrets.ANDROID_PROPERTIES_BASE64 }}" | base64 -d - > key.properties | |
export X_KEYSTORE_PATH="$(pwd)/upload-keystore.jks" | |
echo "X_KEYSTORE_PATH=$X_KEYSTORE_PATH" >> $GITHUB_ENV | |
cp key.properties android/key.properties | |
- name: Bump new version | |
run: | | |
echo "${{ github.event.release.body }}" > changelog.temp | |
python bump_new_version.py ${{ github.event.release.tag_name }} changelog.temp | |
# Commit all changed files back to the repository | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
branch: master | |
file_pattern: 'pubspec.* *.txt' | |
- name: Update the tag | |
run: | | |
git tag -d ${{ github.event.release.tag_name }} | |
git push --delete origin ${{ github.event.release.tag_name }} | |
git tag ${{ github.event.release.tag_name }} | |
git push origin ${{ github.event.release.tag_name }} | |
- name: Build APK | |
run: submodules/flutter/bin/flutter build apk --split-debug-info=./build-debug-files --flavor pro --release --split-per-abi | |
env: | |
X_KEYSTORE_PATH: ${{ env.X_KEYSTORE_PATH }} | |
- name: Upload APK as Release asset | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
build/app/outputs/flutter-apk/app-armeabi-v7a-pro-release.apk | |
build/app/outputs/flutter-apk/app-arm64-v8a-pro-release.apk | |
build/app/outputs/flutter-apk/app-x86_64-pro-release.apk | |
body: ${{ github.event.release.body }} | |
tag_name: ${{ github.event.release.tag_name }} | |
- name: Build app bundle | |
run: | | |
submodules/flutter/bin/flutter build appbundle --obfuscate --split-debug-info=./build-debug-file --flavor free | |
submodules/flutter/bin/flutter build appbundle --obfuscate --split-debug-info=./build-debug-file --flavor pro | |
- name: Publish on Google Play Free | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_DEV_CONSOLE_SERVICE_ACCOUNT_JSON }} | |
packageName: com.github.emavgl.piggybank | |
releaseFiles: build/app/outputs/bundle/freeRelease/app-free-release.aab | |
whatsNewDirectory: metadata/en-US | |
- name: Publish on Google Play Pro | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_DEV_CONSOLE_SERVICE_ACCOUNT_JSON }} | |
packageName: com.github.emavgl.piggybankpro | |
releaseFiles: build/app/outputs/bundle/proRelease/app-pro-release.aab | |
whatsNewDirectory: metadata/en-US |