From 7813aa55762fb56136d33a78184272832ed090be Mon Sep 17 00:00:00 2001 From: j842 Date: Sun, 17 Aug 2025 16:37:56 +1200 Subject: [PATCH] Update publish.sh --- publish.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/publish.sh b/publish.sh index 25e2bed..9d5b0ff 100755 --- a/publish.sh +++ b/publish.sh @@ -54,3 +54,26 @@ mkdir "${TOOLDIR}" cp "${OUTPUT}/${PROJECT}" "${TOOLDIR}/${PROJECT}" "${GETPKG_PATH}" server set-token getpkg.xyz "${SOS_WRITE_TOKEN}" "${GETPKG_PATH}" publish "${PROJECT}:${ARCH}" "${TOOLDIR}" + +#-------------------------------------------------------------------------------- +heading "Publishing ${PROJECT} to getbin.xyz" + +# Download sos if not already present +SOS="${OUTPUT}/sos" +if [ ! -f "${SOS}" ]; then + heading "Downloading sos tool" + curl -L -s -o "${SOS}" "https://getbin.xyz/sos:latest" || die "Failed to download sos" + chmod +x "${SOS}" +fi + +# Upload architecture-specific binary to getbin.xyz +heading "Uploading ${PROJECT} binary to getbin.xyz as ${PROJECT}:latest-${ARCH}" +"${SOS}" upload "getbin.xyz" "${OUTPUT}/${PROJECT}" "${PROJECT}:latest-${ARCH}" || die "Failed to upload ${PROJECT} binary to getbin.xyz" + +# Check if there's an install script to upload +if [ -f "${SCRIPT_DIR}/install.sh" ]; then + heading "Uploading install.sh to getbin.xyz as ${PROJECT}-install:latest" + "${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/install.sh" "${PROJECT}-install:latest" || die "Failed to upload install script to getbin.xyz" +fi + +heading "Successfully published ${PROJECT} to both getpkg.xyz and getbin.xyz"