R7.7: one source archive pair per release

Windows checks out symlinks as files, so only Linux (CI) and macOS
(release.sh) write source archives. ci.sh skips names already on
the release; the first platform's copy stays.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-16 18:34:27 -04:00
1 parent a1b8c18ffd
commit aae000247d
8 files changed
+125 -6

No files matched your search

+24 -2
View File
@@ -66,8 +66,10 @@ case $os in
;;
esac
# macOS's release.sh writes its own source archives.
[ "$os" = macos ] || packaging/source.sh "$dist"
# Windows checkouts flatten symlinks; Linux and macOS write source.
if [ "$os" = linux ]; then
packaging/source.sh "$dist"
fi
# The tag's release, made by whichever platform comes first.
api=https://git.zacharyzhang.com/api/v1/repos/ZacharyZhang-NY/ElyOffice
@@ -79,9 +81,29 @@ if ! id=$(release_id 2>/dev/null); then
curl -fsS -H "$auth" -H "Content-Type: application/json" -d "$body" "$api/releases" >/dev/null || true
id=$(release_id)
fi
names=()
for file in "$dist"/*; do
[ -f "$file" ] || continue
name=$(basename "$file")
# Linux alone publishes the source pair.
if [ "$os" != linux ] && [[ $name == *-source.tar.gz ]]; then
echo "ci.sh: $name is Linux's to upload"
continue
fi
names+=("$name")
done
# Rebuilt bytes differ; never mix them with earlier uploads.
have=$(curl -fsS -H "$auth" "$api/releases/$id/assets" | python3 -c 'import json, sys; print("\n".join(a["name"] for a in json.load(sys.stdin)))')
taken=()
for name in "${names[@]}"; do
if grep -qxF "$name" <<<"$have"; then taken+=("$name"); fi
done
if [ ${#taken[@]} -gt 0 ]; then
echo "ci.sh: already on $tag; delete them, then rerun: ${taken[*]}" >&2
exit 1
fi
for name in "${names[@]}"; do
file=$dist/$name
echo "ci.sh: uploading $name"
curl -fsS -H "$auth" -F "attachment=@$file" "$api/releases/$id/assets?name=$name" >/dev/null
done