diff --git a/templates/build-flutter.yml b/templates/build-flutter.yml index 944a198999..e9146aca99 100644 --- a/templates/build-flutter.yml +++ b/templates/build-flutter.yml @@ -2,6 +2,8 @@ # Starting from the following template and grep for "flutter" in the metadata # 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: - versionName: '1.0' @@ -27,10 +29,9 @@ Builds: prebuild: # Extract the flutter version and then checkout it in the flutter srclib # Only needed when flutter srclib is used - - version=$(sed -n -E "s/.*flutter-version:\ '(.*)'/\1/p" .github/workflows/release.yml) - - pushd $$flutter$$ - - git checkout -f $version - - popd + - flutterVersion=$(sed -n -E "s/.*flutter-version:\ '(.*)'/\1/p" .github/workflows/release.yml) + - '[[ $flutterVersion ]] || exit 1' + - git -C $$flutter$$ checkout -f $flutterVersion # Change pub cache location so that the dart packages are scanned by the scanner - export PUB_CACHE=$(pwd)/.pub-cache - .flutter/bin/flutter config --no-analytics