This commit is contained in:
parent
b9785180b6
commit
ce10325a7f
@ -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}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user