fix(release): upload a tarball then extract remotely
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-11 01:19:59
Commite2d45950
Parentsea2f48f5
Changed files
release-dist.sh+7−4■■■■■
1 file+7−4
Diff
release-dist.sh+7−4■■■■■
index ade6e0f..8aa7283 100755
--- a/release-dist.sh
+++ b/release-dist.sh
@@ -283,10 +283,13 @@ REMOTE_DIR="$DIST_PATH/bot-plugins/$SLUG/$VERSION"
283283
284284 "${SSH[@]}" "$DIST_HOST" "mkdir -p '$REMOTE_DIR' '$DIST_PATH/bot-plugins/$SLUG'" \
285285 || die "cannot create $REMOTE_DIR on $DIST_HOST"
286-# tar-over-ssh: one transfer, preserves modes, and avoids OpenSSH 9's
287-# refusal to scp a bare "." source.
288-tar -czf - -C "$PKG" . \
289- | "${SSH[@]}" "$DIST_HOST" "tar -xzf - -C '$REMOTE_DIR'" || die "upload failed"
286+# Stage to one tarball, transfer it, extract remotely. Streaming tar through
287+# ssh corrupts on some OpenSSH builds (remote gzip dies with SIGPIPE), and
288+# OpenSSH 9 refuses to scp a bare "." source.
289+tar -czf "$STAGE/pkg.tar.gz" -C "$PKG" . || die "packaging failed"
290+"${SCP[@]}" -q "$STAGE/pkg.tar.gz" "$DIST_HOST:$REMOTE_DIR/pkg.tar.gz" || die "upload failed"
291+"${SSH[@]}" "$DIST_HOST" "cd '$REMOTE_DIR' && tar -xzf pkg.tar.gz && rm -f pkg.tar.gz" \
292+ || die "remote extract failed"
290293 echo " uploaded to $DIST_HOST:$REMOTE_DIR"
291294
292295 # latest.json = copy of this version's manifest
293296
release-dist.sh+7−4■■■■■
index ade6e0f..8aa7283 100755index ade6e0f..8aa7283 100755
--- a/release-dist.sh--- a/release-dist.sh
+++ b/release-dist.sh+++ b/release-dist.sh
@@ -283,10 +283,13 @@ REMOTE_DIR="$DIST_PATH/bot-plugins/$SLUG/$VERSION"@@ -283,10 +283,13 @@ REMOTE_DIR="$DIST_PATH/bot-plugins/$SLUG/$VERSION"
283 283
284 "${SSH[@]}" "$DIST_HOST" "mkdir -p '$REMOTE_DIR' '$DIST_PATH/bot-plugins/$SLUG'" \284 "${SSH[@]}" "$DIST_HOST" "mkdir -p '$REMOTE_DIR' '$DIST_PATH/bot-plugins/$SLUG'" \
285 || die "cannot create $REMOTE_DIR on $DIST_HOST"285 || die "cannot create $REMOTE_DIR on $DIST_HOST"
286-# tar-over-ssh: one transfer, preserves modes, and avoids OpenSSH 9's286+# Stage to one tarball, transfer it, extract remotely. Streaming tar through
287-# refusal to scp a bare "." source.287+# ssh corrupts on some OpenSSH builds (remote gzip dies with SIGPIPE), and
288-tar -czf - -C "$PKG" . \288+# OpenSSH 9 refuses to scp a bare "." source.
289- | "${SSH[@]}" "$DIST_HOST" "tar -xzf - -C '$REMOTE_DIR'" || die "upload failed"289+tar -czf "$STAGE/pkg.tar.gz" -C "$PKG" . || die "packaging failed"
290+"${SCP[@]}" -q "$STAGE/pkg.tar.gz" "$DIST_HOST:$REMOTE_DIR/pkg.tar.gz" || die "upload failed"
291+"${SSH[@]}" "$DIST_HOST" "cd '$REMOTE_DIR' && tar -xzf pkg.tar.gz && rm -f pkg.tar.gz" \
292+ || die "remote extract failed"
290 echo " uploaded to $DIST_HOST:$REMOTE_DIR"293 echo " uploaded to $DIST_HOST:$REMOTE_DIR"
291 294
292 # latest.json = copy of this version's manifest295 # latest.json = copy of this version's manifest
293296