'Generic Commit'
Some checks failed
Build-Test-Publish / build (push) Failing after 11s

This commit is contained in:
Your Name 2025-06-22 09:42:54 +12:00
parent b9785180b6
commit ce10325a7f

View File

@ -6,7 +6,16 @@ ARCH=$(uname -m)
PROJECT="getpkg" PROJECT="getpkg"
OUTPUT="${SCRIPT_DIR}/output" 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() { function die() {
title "error: $1" title "error: $1"
@ -19,6 +28,10 @@ function die() {
rm -rf "${OUTPUT}" rm -rf "${OUTPUT}"
mkdir -p "${OUTPUT}" mkdir -p "${OUTPUT}"
#--------------------------------------------------------------------------------
heading "Building ${PROJECT}"
# build release version # build release version
export CMAKE_BUILD_TYPE="Release" export CMAKE_BUILD_TYPE="Release"
@ -32,6 +45,8 @@ docker build \
[ -f "${OUTPUT}/${PROJECT}" ] || die "Build failed." [ -f "${OUTPUT}/${PROJECT}" ] || die "Build failed."
#--------------------------------------------------------------------------------
heading "Downloading SOS"
# download the sos binary # download the sos binary
TEMP_DIR="${OUTPUT}/temp" TEMP_DIR="${OUTPUT}/temp"
SOS="${TEMP_DIR}/sos" SOS="${TEMP_DIR}/sos"
@ -41,12 +56,18 @@ curl -L -o "${SOS}" "https://getbin.xyz/sos"
[ -f "${SOS}" ] || die "Failed to download sos" [ -f "${SOS}" ] || die "Failed to download sos"
chmod +x "${SOS}" chmod +x "${SOS}"
#--------------------------------------------------------------------------------
heading "Uploading ${PROJECT} to getbin.xyz"
# upload arch-specific binary # upload arch-specific binary
"${SOS}" upload "getbin.xyz" "${OUTPUT}/${PROJECT}" "${PROJECT}:latest-${ARCH}" "${SOS}" upload "getbin.xyz" "${OUTPUT}/${PROJECT}" "${PROJECT}:latest-${ARCH}"
# upload generic install script (ok if multiple times as we iterate through arch's) # 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" "${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" TOOLDIR="${OUTPUT}/tool"
mkdir "${TOOLDIR}" mkdir "${TOOLDIR}"
cp "${OUTPUT}/${PROJECT}" "${TOOLDIR}/${PROJECT}" cp "${OUTPUT}/${PROJECT}" "${TOOLDIR}/${PROJECT}"