feat: Allow git ref as version in master channel (#237)

* feat: Allow git ref as version in `master` channel

* fix lint

* fix parsing

* fix test

* fix checkout, add tests

* replace with tab
This commit is contained in:
Gustl22
2023-10-11 10:55:21 +02:00
committed by GitHub
parent ed388baf1d
commit cc97e1648f
3 changed files with 25 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ else
fi
if [[ "$CHANNEL" == "master" ]]; then
VERSION_MANIFEST="{\"channel\":\"$CHANNEL\",\"version\":\"$CHANNEL\",\"dart_sdk_arch\":\"$ARCH\",\"hash\":\"$CHANNEL\",\"sha256\":\"$CHANNEL\"}"
VERSION_MANIFEST="{\"channel\":\"$CHANNEL\",\"version\":\"$VERSION\",\"dart_sdk_arch\":\"$ARCH\",\"hash\":\"$CHANNEL\",\"sha256\":\"$CHANNEL\"}"
else
VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION")
fi
@@ -157,6 +157,10 @@ fi
if [[ ! -x "$CACHE_PATH/bin/flutter" ]]; then
if [[ "$CHANNEL" == "master" ]]; then
git clone -b master https://github.com/flutter/flutter.git "$CACHE_PATH"
if [[ "$VERSION" != "any" ]]; then
git config --global --add safe.directory "$CACHE_PATH"
(cd "$CACHE_PATH" && git checkout "$VERSION")
fi
else
archive_url=$(echo "$VERSION_MANIFEST" | jq -r '.archive')
download_archive "$archive_url" "$CACHE_PATH"