From 53e85c258c67244773e1fa91f117386a30a31712 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 2 Sep 2025 20:46:53 +1200 Subject: [PATCH] Update publish.sh --- publish.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/publish.sh b/publish.sh index c570c9e..4306408 100755 --- a/publish.sh +++ b/publish.sh @@ -64,8 +64,12 @@ done # Check if SOS_WRITE_TOKEN is set [[ -n $SOS_WRITE_TOKEN ]] || die "SOS_WRITE_TOKEN environment variable not set" -# Check if sos is installed -which sos >/dev/null || die "sos tool not found. Please install it first." +# Always download the latest sos to ensure compatibility +info "Downloading latest sos utility..." +SOS_BIN="$TMPDIR/sos" +curl -L -o "$SOS_BIN" "https://getbin.xyz/sos:latest-$ARCH" 2>/dev/null || die "Failed to download sos" +chmod +x "$SOS_BIN" +info "sos downloaded successfully" # If no specific templates specified and not --all, default to changed templates if [ -z "$TEMPLATES_TO_PUBLISH" ] && [ "$PUBLISH_ALL" = false ]; then @@ -144,17 +148,17 @@ for TEMPLATE in $TEMPLATES_TO_PUBLISH; do info "Uploading $TEMPLATE to templates.dropshell.app" # Always upload with :latest tag - sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:latest" --metadata "unpackedhash=$SHA256_HASH" || die "Failed to upload $TEMPLATE:latest" + "$SOS_BIN" upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:latest" --metadata "unpackedhash=$SHA256_HASH" || die "Failed to upload $TEMPLATE:latest" info "Uploaded ${TEMPLATE}:latest" # Also upload with specific version tag - sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:${VERSION}" --metadata "unpackedhash=$SHA256_HASH" || die "Failed to upload $TEMPLATE:${VERSION}" + "$SOS_BIN" upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:${VERSION}" --metadata "unpackedhash=$SHA256_HASH" || die "Failed to upload $TEMPLATE:${VERSION}" info "Uploaded ${TEMPLATE}:${VERSION}" # If we have a major version, also tag with major version only (e.g., v1) MAJOR_VERSION=$(echo "$VERSION" | cut -d. -f1) if [ -n "$MAJOR_VERSION" ]; then - sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:v${MAJOR_VERSION}" --metadata "unpackedhash=$SHA256_HASH" || die "Failed to upload $TEMPLATE:v${MAJOR_VERSION}" + "$SOS_BIN" upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:v${MAJOR_VERSION}" --metadata "unpackedhash=$SHA256_HASH" || die "Failed to upload $TEMPLATE:v${MAJOR_VERSION}" info "Uploaded ${TEMPLATE}:v${MAJOR_VERSION}" fi