Update Flutter submodule and make GitHub actions error out if it doesn't match latest/stable

This commit is contained in:
Imran Remtulla
2024-01-22 12:21:38 -05:00
parent fac335c849
commit f06de8d19f
3 changed files with 22 additions and 8 deletions

View File

@ -23,6 +23,17 @@ jobs:
gpg_private_key: ${{ secrets.PGP_KEY_BASE64 }}
passphrase: ${{ secrets.PGP_PASSPHRASE }}
- name: Check submodule
id: check_submodule
run: |
SUBMODULE_COMMIT="$(cd .flutter; git rev-parse --short HEAD; cd ..)"
FLUTTER_COMMIT="$(flutter --version | head -2 | tail -1 | awk '{print $4}')"
echo "SUBMODULE_COMMIT=$SUBMODULE_COMMIT, FLUTTER_COMMIT=$FLUTTER_COMMIT"
if [ "$SUBMODULE_COMMIT" != "$FLUTTER_COMMIT" ]; then
echo "Your submodule has not been updated!"
exit 1
fi
- name: Extract Version
id: extract_version
run: |

View File

@ -7,6 +7,9 @@ trap "cd "$CURR_DIR"" EXIT
if [ -z "$1" ]; then
git fetch && git merge origin/main && git push # Typically run after a PR to main, so bring dev up to date
fi
cd .flutter
git checkout "$(flutter --version | head -2 | tail -1 | awk '{print $4}')" # Ensure included Flutter submodule version equals my environment
cd ..
rm ./build/app/outputs/flutter-apk/* 2>/dev/null # Get rid of older builds if any
flutter build apk --flavor normal && flutter build apk --split-per-abi --flavor normal # Build (both split and combined APKs)
for file in ./build/app/outputs/flutter-apk/app-*normal*.apk*; do mv "$file" "${file//-normal/}"; done