2 Commits
Author SHA1 Message Date
VeillaxandClaude Sonnet 5.5 23550176a6 Retry release uploads that hit a proxy timeout, and replace every existing asset on re-run
CI / test (push) Successful in 2m15s
Release / release (push) Successful in 19m20s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 14:56:57 -06:00
VeillaxandClaude Sonnet 5.5 189304938e Fix the staged install link used by DESTDIR
CI / test (push) Successful in 2m35s
Release / release (push) Failing after 10m25s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 14:01:41 -06:00
2 changed files with 21 additions and 8 deletions

No files matched your search

+3 -1
View File
@@ -51,7 +51,9 @@ mkdir -p "$LIB"
install -m 0755 "$HERE/$NAME" "$LIB/$NAME.new" install -m 0755 "$HERE/$NAME" "$LIB/$NAME.new"
mv -f "$LIB/$NAME.new" "$LIB/$NAME" # atomic, so upgrading a running service is safe mv -f "$LIB/$NAME.new" "$LIB/$NAME" # atomic, so upgrading a running service is safe
rm -f "$BIN" rm -f "$BIN"
ln -s "/usr/local/lib/$NAME/$NAME" "$BIN" LINK=/usr/local/lib/$NAME/$NAME
[ -z "${DESTDIR:-}" ] || LINK=$LIB/$NAME # staging: point inside the staging folder
ln -s "$LINK" "$BIN"
if [ -f "$HERE/traefik" ]; then if [ -f "$HERE/traefik" ]; then
install -m 0755 "$HERE/traefik" "$ROOT/usr/local/lib/$NAME/traefik.new" install -m 0755 "$HERE/traefik" "$ROOT/usr/local/lib/$NAME/traefik.new"
mv -f "$ROOT/usr/local/lib/$NAME/traefik.new" "$ROOT/usr/local/lib/$NAME/traefik" mv -f "$ROOT/usr/local/lib/$NAME/traefik.new" "$ROOT/usr/local/lib/$NAME/traefik"
+18 -7
View File
@@ -42,19 +42,30 @@ else
echo "release $TAG already exists (id $id): replacing its files" echo "release $TAG already exists (id $id): replacing its files"
fi fi
existing=$(curl -fsS -H "$AUTH" "$API/releases/$id/assets" | json 'import sys, json # the ids of the release's assets with a given name (a failed upload can leave a partial one behind)
asset_ids() {
curl -fsS -H "$AUTH" "$API/releases/$id/assets" | "$PY" -c 'import sys, json
for a in json.load(sys.stdin): for a in json.load(sys.stdin):
print(a["id"], a["name"])') if a["name"] == sys.argv[1]:
print(a["id"])' "$1"
}
for f in dist/*.tar.gz dist/*.zip dist/SHA256SUMS; do for f in dist/*.tar.gz dist/*.zip dist/SHA256SUMS; do
[ -f "$f" ] || continue [ -f "$f" ] || continue
name=$(basename "$f") name=$(basename "$f")
echo "$existing" | while read -r aid aname; do n=1
if [ "$aname" = "$name" ]; then while :; do
for aid in $(asset_ids "$name"); do
curl -fsS -X DELETE -H "$AUTH" "$API/releases/$id/assets/$aid" > /dev/null curl -fsS -X DELETE -H "$AUTH" "$API/releases/$id/assets/$aid" > /dev/null
fi
done done
echo "uploading $name" echo "uploading $name (attempt $n)"
curl -fsS -X POST -H "$AUTH" -F "attachment=@$f" "$API/releases/$id/assets?name=$name" > /dev/null if curl -fsS --max-time 1200 -X POST -H "$AUTH" -F "attachment=@$f" "$API/releases/$id/assets?name=$name" > /dev/null; then
break
fi
# large uploads can hit a proxy timeout (HTTP 502); try again
[ "$n" -lt 5 ] || { echo "giving up on $name after $n attempts" >&2; exit 1; }
n=$((n + 1))
sleep $((n * 10))
done
done done
echo "published $SERVER/$REPO/releases/tag/$TAG" echo "published $SERVER/$REPO/releases/tag/$TAG"