A 7th package, lucisv-<v>-all.vsix, carries every platform's binary pair under bin/<platform>-<arch>/ and the extension picks the right one at runtime — flat bin/ (platform package) first, then the platform-arch subdirectory, then PATH. Target-less on purpose, so Alpine and anything else vsce refuses to name gets working static binaries. The release.yml inline prune step moves into tools/prune_release_assets.sh, which now requires all seven packages by name before anything is published. Co-Authored-By: Claude Fable 5 <[email protected]>
43 lines
1.8 KiB
Bash
Executable File
43 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Reduce a built dist/ directory to the assets a release publishes.
|
|
#
|
|
# Usage: tools/prune_release_assets.sh <dist-dir> <version>
|
|
# tools/prune_release_assets.sh dist 0.10.0
|
|
#
|
|
# A release page carries the seven .vsix packages and SHA256SUMS, nothing else
|
|
# (docs/features/ci-release): the extension is the product, and the loose
|
|
# per-triple binaries exist only so the packages can be built and audited from
|
|
# them. Every package is checked by name first -- tools/release.sh would have
|
|
# failed earlier, but a release quietly missing a platform is exactly the
|
|
# failure this step exists to prevent -- then SHA256SUMS is *filtered* down to
|
|
# its .vsix lines rather than recomputed, so the hashes published are the ones
|
|
# tools/audit_artifacts.sh already gated on, everything else is deleted, and
|
|
# what remains is re-verified the way a downloader would.
|
|
#
|
|
# Exit status: 0 if all seven packages were present and verified.
|
|
|
|
set -eu
|
|
|
|
[ $# -eq 2 ] || { echo "usage: $0 <dist-dir> <version>" >&2; exit 2; }
|
|
dist=$1
|
|
version=$2
|
|
[ -d "$dist" ] || { echo "no dist directory at $dist" >&2; exit 2; }
|
|
[ -f "$dist/SHA256SUMS" ] || { echo "no SHA256SUMS in $dist" >&2; exit 2; }
|
|
|
|
cd "$dist"
|
|
|
|
# The universal fallback, the five platform packages, and the all-platforms one.
|
|
# Each is a must: a missing platform package strands that platform's users on
|
|
# "install a binary yourself", which is the whole thing these packages fix.
|
|
for suffix in "" -darwin-arm64 -darwin-x64 -linux-x64 -linux-arm64 -win32-x64 -all; do
|
|
[ -f "lucisv-$version$suffix.vsix" ] || {
|
|
echo "missing lucisv-$version$suffix.vsix" >&2
|
|
exit 1
|
|
}
|
|
done
|
|
|
|
grep '\.vsix$' SHA256SUMS > SHA256SUMS.tmp
|
|
mv SHA256SUMS.tmp SHA256SUMS
|
|
find . -type f ! -name '*.vsix' ! -name SHA256SUMS -delete
|
|
shasum -a 256 -c SHA256SUMS
|