test: Update 3 files
All checks were successful
Build-Test-Publish / build (linux/arm64) (push) Successful in 32s
Build-Test-Publish / build (linux/amd64) (push) Successful in 32s

This commit is contained in:
Your Name
2025-09-02 20:41:02 +12:00
parent 944cc63502
commit f3cc793b5a
3 changed files with 125 additions and 6 deletions

View File

@@ -1,9 +1,12 @@
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ARCH=$(uname -m)
PROJECT="$(basename "${SCRIPT_DIR}")"
OUTPUT="${SCRIPT_DIR}/output"
VERSION=$(date -u +"%Y.%m%d.%H%M")
function heading() {
@@ -45,7 +48,11 @@ heading "Publishing ${PROJECT} as tool to ${PROJECT}:${ARCH} (on getpkg.xyz)"
TOOLDIR="${OUTPUT}/tool"
mkdir "${TOOLDIR}"
cp "${PROJECT}" "${TOOLDIR}/${PROJECT}"
# Copy the script and replace __VERSION__ with the actual version
sed "s|__VERSION__|${VERSION}|g" "${PROJECT}" > "${TOOLDIR}/${PROJECT}"
chmod +x "${TOOLDIR}/${PROJECT}"
"${GETPKG_PATH}" server set-token getpkg.xyz "${SOS_WRITE_TOKEN}"
"${GETPKG_PATH}" publish "${PROJECT}:${ARCH}" "${TOOLDIR}"
@@ -62,7 +69,7 @@ fi
# Upload architecture-specific binary to getbin.xyz
heading "Uploading ${PROJECT} binary to getbin.xyz as ${PROJECT}:latest-${ARCH}"
"${SOS}" upload "getbin.xyz" "${PROJECT}" "${PROJECT}:latest-${ARCH}" || die "Failed to upload ${PROJECT} binary to getbin.xyz"
"${SOS}" upload "getbin.xyz" "${TOOLDIR}/${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