Bump Flutter submodule #15
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
# .github/workflows/bump_submodule.yaml | |
name: Bump Flutter submodule | |
on: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
bump_submodule: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Git user | |
uses: fregante/setup-git-user@v2 | |
- name: Save Flutter version | |
run: | | |
git submodule update --init | |
OLD_FLUTTER_VERSION=$(.flutter/bin/flutter --version | grep 'Flutter' | sed 's/Flutter //;s/ .*//') | |
echo "OLD_FLUTTER_VERSION=$OLD_FLUTTER_VERSION" >> $GITHUB_ENV | |
- name: Bump Flutter submodule | |
run: | | |
git submodule update --remote --init | |
- name: Commit changes | |
run: | | |
git add .flutter | |
if ! git diff-index --quiet HEAD; then | |
NEW_FLUTTER_VERSION=$(.flutter/bin/flutter --version | grep 'Flutter' | sed 's/Flutter //;s/ .*//') | |
git commit -m "Bump Flutter submodule" -m "Flutter version: ${{ env.OLD_FLUTTER_VERSION }} -> $NEW_FLUTTER_VERSION" | |
git push origin main | |
fi | |
- name: Print Flutter version | |
run: .flutter/bin/flutter --version |