ci(block): release job refuses an asset whose binaries are not executable

The release job lists the tarball (tar -tvzf) before SHA256SUMS and any
upload, and stops unless blockmaster, blockvolume and sw-block are all
present with exec bits for owner, group and other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-12-06 07:55:43 -08:00
1 parent c1c7679a29
commit 90f6d7cfea
2 files changed
+36 -1

No files matched your search

+16
View File
@@ -138,6 +138,22 @@ jobs:
cp seaweed-block/deploy/systemd/sw-block.tmpfiles.conf "$out/bin/sw-block.tmpfiles.conf"
asset="sw-block-${version}-linux-amd64.tar.gz"
tar -C "$out/bin" -czf "$out/$asset" blockmaster blockvolume sw-block sw-block.tmpfiles.conf
# Before any upload: every binary in the asset is executable as shipped (tar tvf).
executables=0
while read -r perms _ _ _ _ name; do
case "$name" in
blockmaster|blockvolume|sw-block)
if [[ ! "$perms" =~ ^-..x..x..x$ ]]; then
echo "refusing to publish: $name in $asset is $perms, not executable" >&2
exit 1
fi
executables=$((executables + 1)) ;;
esac
done < <(tar -tvzf "$out/$asset")
if [ "$executables" != 3 ]; then
echo "refusing to publish: $asset lists $executables of 3 binaries" >&2
exit 1
fi
(cd "$out" && sha256sum "$asset" >SHA256SUMS)
prerelease=false
if [[ "$version" == *-* ]]; then prerelease=true; fi