mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-07-01 15:35:45 +00:00
update flutter.sh
This commit is contained in:
parent
c70f8b6ddf
commit
82f9738ebc
38
flutter.sh
38
flutter.sh
@ -2,7 +2,7 @@
|
|||||||
# requires: curl, unzip, gsutil, jq
|
# requires: curl, unzip, gsutil, jq
|
||||||
|
|
||||||
DEST_DIR="${TUNASYNC_WORKING_DIR}"
|
DEST_DIR="${TUNASYNC_WORKING_DIR}"
|
||||||
STABLE_VERSION_ENGINE=true
|
SYNC_FLUTTER_ENGINES=latest_tags
|
||||||
|
|
||||||
gsutil rsync -d -C -r -x '(1\..+/|\d{5}/|.+/api-docs)' gs://dart-archive/channels/stable/release \
|
gsutil rsync -d -C -r -x '(1\..+/|\d{5}/|.+/api-docs)' gs://dart-archive/channels/stable/release \
|
||||||
"${DEST_DIR}/dart-archive/channels/stable/release"
|
"${DEST_DIR}/dart-archive/channels/stable/release"
|
||||||
@ -10,27 +10,35 @@ gsutil rsync -d -C -r -x '(dev|beta)' gs://flutter_infra/releases \
|
|||||||
"${DEST_DIR}/flutter_infra/releases"
|
"${DEST_DIR}/flutter_infra/releases"
|
||||||
|
|
||||||
|
|
||||||
if [[ "$STABLE_VERSION_ENGINE" == "true" ]];then
|
function sync_engine() {
|
||||||
for i in ${DEST_DIR}/flutter_infra/releases/stable/macos/*.zip; do
|
[[ -z "$1" ]] && exit 1
|
||||||
engine_version=$(unzip -p "$i" flutter/bin/internal/engine.version)
|
path="flutter_infra/flutter/$1"
|
||||||
echo "======== name ${i##*/}, engine version ($engine_version) ========"
|
mkdir -p "${DEST_DIR}/$path" 2>/dev/null || true
|
||||||
path=flutter_infra/flutter/$engine_version
|
gsutil -m rsync -d -C -r "gs://$path" "${DEST_DIR}/$path"
|
||||||
mkdir -p "${DEST_DIR}/$path" 2>/dev/null || true
|
}
|
||||||
gsutil -m rsync -d -C -r "gs://$path" "${DEST_DIR}/$path"
|
|
||||||
done
|
if [[ "$SYNC_FLUTTER_ENGINES" == "recent_tags" ]]; then
|
||||||
else
|
|
||||||
curl -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/flutter/flutter/tags" | \
|
curl -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/flutter/flutter/tags" | \
|
||||||
jq -r '.[]| [.name]| @tsv' | \
|
jq -r '.[]| [.name]| @tsv' | \
|
||||||
while IFS=$'\t' read -r name; do
|
while IFS=$'\t' read -r name; do
|
||||||
engine_version=$(curl "https://raw.githubusercontent.com/flutter/flutter/$name/bin/internal/engine.version")
|
engine_version=$(curl "https://raw.githubusercontent.com/flutter/flutter/$name/bin/internal/engine.version")
|
||||||
echo "======== tag $name, engine version ($engine_version) ========"
|
echo "======== tag $name, engine version ($engine_version) ========"
|
||||||
path=flutter_infra/flutter/$engine_version
|
sync_engine "$engine_version"
|
||||||
mkdir -p "${DEST_DIR}/$path" 2>/dev/null || true
|
|
||||||
gsutil -m rsync -d -C -r "gs://$path" "${DEST_DIR}/$path"
|
|
||||||
done
|
done
|
||||||
fi
|
elif [[ "$SYNC_FLUTTER_ENGINES" == "latest_tags" ]]; then
|
||||||
|
for branch in stable beta dev; do
|
||||||
|
engine_version=$(curl "https://raw.githubusercontent.com/flutter/flutter/$branch/bin/internal/engine.version")
|
||||||
|
echo "======== branch ${branch}, engine version ($engine_version) ========"
|
||||||
|
sync_engine "$engine_version"
|
||||||
|
|
||||||
exit 0
|
for i in ${DEST_DIR}/flutter_infra/releases/${branch}/macos/*.zip; do
|
||||||
|
[[ -f "$i" ]] || continue
|
||||||
|
engine_version=$(unzip -p "$i" flutter/bin/internal/engine.version)
|
||||||
|
echo "======== installer name ${i##*/}, engine version ($engine_version) ========"
|
||||||
|
sync_engine "$engine_version"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
for path in "flutter_infra/ios-usb-dependencies" \
|
for path in "flutter_infra/ios-usb-dependencies" \
|
||||||
"flutter_infra/flutter/fonts" \
|
"flutter_infra/flutter/fonts" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user