feat: Update 2 files
This commit is contained in:
27
publish.sh
27
publish.sh
@@ -27,6 +27,12 @@ export INSTALL_LOCAL="false"
|
||||
|
||||
[ -f "${SCRIPT_DIR}/output/dropshell" ] || die "Build failed."
|
||||
|
||||
# Get version from the built binary (format: YYYY.MMDD.HHMM)
|
||||
VERSION=$("${SCRIPT_DIR}/output/dropshell" version | tr -d '[:space:]')
|
||||
[ -z "$VERSION" ] && die "Failed to get version from dropshell"
|
||||
|
||||
echo "Publishing dropshell version ${VERSION} for ${ARCH}"
|
||||
|
||||
# download the sos binary
|
||||
mkdir -p "${TEMP_DIR}"
|
||||
trap 'rm -rf "${TEMP_DIR}"' EXIT
|
||||
@@ -34,8 +40,23 @@ trap 'rm -rf "${TEMP_DIR}"' EXIT
|
||||
curl -L -o "${SOS}" "https://getbin.xyz/sos"
|
||||
chmod +x "${SOS}"
|
||||
|
||||
# upload arch-specific binary
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/output/${PROJECT}" "${PROJECT}:latest-${ARCH}"
|
||||
# Create metadata file with version information
|
||||
METADATA_FILE="${TEMP_DIR}/metadata.json"
|
||||
cat > "${METADATA_FILE}" <<EOF
|
||||
{
|
||||
"version": "${VERSION}",
|
||||
"architecture": "${ARCH}",
|
||||
"project": "${PROJECT}"
|
||||
}
|
||||
EOF
|
||||
|
||||
# upload arch-specific binary with metadata
|
||||
# The sos tool should support --metadata flag or similar for version info
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/output/${PROJECT}" "${PROJECT}:latest-${ARCH}" \
|
||||
--metadata "version=${VERSION}"
|
||||
|
||||
# Also upload with version-specific tag for direct version access
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/output/${PROJECT}" "${PROJECT}:${VERSION}-${ARCH}"
|
||||
|
||||
# upload generic install script
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/dropshell-install.sh" "dropshell-install:latest"
|
||||
@@ -43,4 +64,4 @@ chmod +x "${SOS}"
|
||||
# upload server auto-setup script
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/dropshell-server-autosetup.sh" "dropshell-server-autosetup:latest"
|
||||
|
||||
echo "Successfully published dropshell:latest-${ARCH} to getbin.xyz"
|
||||
echo "Successfully published dropshell:latest-${ARCH} (version ${VERSION}) to getbin.xyz"
|
Reference in New Issue
Block a user