update build-flutter template

This commit is contained in:
linsui 2024-05-08 21:51:45 +08:00 committed by linsui
parent b6d6427e85
commit 88e05a61eb

View File

@ -2,6 +2,8 @@
# Starting from the following template and grep for "flutter" in the metadata # Starting from the following template and grep for "flutter" in the metadata
# directory to see other examples. # directory to see other examples.
# Only choose one method between flutter submodule and srclib. If submodule method
# is chosen then please add flutter as a submodule in the source repo.
Builds: Builds:
- versionName: '1.0' - versionName: '1.0'
@ -27,10 +29,9 @@ Builds:
prebuild: prebuild:
# Extract the flutter version and then checkout it in the flutter srclib # Extract the flutter version and then checkout it in the flutter srclib
# Only needed when flutter srclib is used # Only needed when flutter srclib is used
- version=$(sed -n -E "s/.*flutter-version:\ '(.*)'/\1/p" .github/workflows/release.yml) - flutterVersion=$(sed -n -E "s/.*flutter-version:\ '(.*)'/\1/p" .github/workflows/release.yml)
- pushd $$flutter$$ - '[[ $flutterVersion ]] || exit 1'
- git checkout -f $version - git -C $$flutter$$ checkout -f $flutterVersion
- popd
# Change pub cache location so that the dart packages are scanned by the scanner # Change pub cache location so that the dart packages are scanned by the scanner
- export PUB_CACHE=$(pwd)/.pub-cache - export PUB_CACHE=$(pwd)/.pub-cache
- .flutter/bin/flutter config --no-analytics - .flutter/bin/flutter config --no-analytics