From ce10325a7fa08406df7f93076fadfba184d9dac8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 22 Jun 2025 09:42:54 +1200 Subject: [PATCH] 'Generic Commit' --- getpkg/publish.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/getpkg/publish.sh b/getpkg/publish.sh index aeec3dc..92c6907 100755 --- a/getpkg/publish.sh +++ b/getpkg/publish.sh @@ -6,7 +6,16 @@ ARCH=$(uname -m) PROJECT="getpkg" OUTPUT="${SCRIPT_DIR}/output" -echo "Publishing ${PROJECT} to gitea.jde.nz/public/${PROJECT}:latest" + +function heading() { + # print a heading with a line of dashe + echo "--------------------------------" + echo "$1" + echo "--------------------------------" +} + +#-------------------------------------------------------------------------------- +heading "Publishing ${PROJECT}" function die() { title "error: $1" @@ -19,6 +28,10 @@ function die() { rm -rf "${OUTPUT}" mkdir -p "${OUTPUT}" + +#-------------------------------------------------------------------------------- +heading "Building ${PROJECT}" + # build release version export CMAKE_BUILD_TYPE="Release" @@ -32,6 +45,8 @@ docker build \ [ -f "${OUTPUT}/${PROJECT}" ] || die "Build failed." +#-------------------------------------------------------------------------------- +heading "Downloading SOS" # download the sos binary TEMP_DIR="${OUTPUT}/temp" SOS="${TEMP_DIR}/sos" @@ -41,12 +56,18 @@ curl -L -o "${SOS}" "https://getbin.xyz/sos" [ -f "${SOS}" ] || die "Failed to download sos" chmod +x "${SOS}" +#-------------------------------------------------------------------------------- +heading "Uploading ${PROJECT} to getbin.xyz" + # upload arch-specific binary "${SOS}" upload "getbin.xyz" "${OUTPUT}/${PROJECT}" "${PROJECT}:latest-${ARCH}" # upload generic install script (ok if multiple times as we iterate through arch's) "${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/install.sh" "${PROJECT}-install:latest" +#-------------------------------------------------------------------------------- +heading "Publishing ${PROJECT} as tool to getpkg:${ARCH} (on getpkg.xyz)" + TOOLDIR="${OUTPUT}/tool" mkdir "${TOOLDIR}" cp "${OUTPUT}/${PROJECT}" "${TOOLDIR}/${PROJECT}"