Update publish.sh
Some checks failed
Test and Publish Templates / test-and-publish (push) Failing after 15s
Some checks failed
Test and Publish Templates / test-and-publish (push) Failing after 15s
This commit is contained in:
14
publish.sh
14
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
|
||||
|
||||
|
Reference in New Issue
Block a user