Update 2 files
This commit is contained in:
@@ -6,6 +6,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
PROJECT="$(basename "${SCRIPT_DIR}")"
|
PROJECT="$(basename "${SCRIPT_DIR}")"
|
||||||
OUTPUT="${SCRIPT_DIR}/output"
|
OUTPUT="${SCRIPT_DIR}/output"
|
||||||
|
VERSION=$(date -u +"%Y.%m%d.%H%M")
|
||||||
|
|
||||||
function heading() {
|
function heading() {
|
||||||
# print a heading with a line of dashes
|
# print a heading with a line of dashes
|
||||||
@@ -45,7 +46,11 @@ heading "Publishing ${PROJECT} as tool to ${PROJECT}:${ARCH} (on getpkg.xyz)"
|
|||||||
|
|
||||||
TOOLDIR="${OUTPUT}/tool"
|
TOOLDIR="${OUTPUT}/tool"
|
||||||
mkdir "${TOOLDIR}"
|
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}" server set-token getpkg.xyz "${SOS_WRITE_TOKEN}"
|
||||||
"${GETPKG_PATH}" publish "${PROJECT}:${ARCH}" "${TOOLDIR}"
|
"${GETPKG_PATH}" publish "${PROJECT}:${ARCH}" "${TOOLDIR}"
|
||||||
|
|
||||||
@@ -62,7 +67,7 @@ fi
|
|||||||
|
|
||||||
# Upload architecture-specific binary to getbin.xyz
|
# Upload architecture-specific binary to getbin.xyz
|
||||||
heading "Uploading ${PROJECT} binary to getbin.xyz as ${PROJECT}:latest-${ARCH}"
|
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
|
# Check if there's an install script to upload
|
||||||
if [ -f "${SCRIPT_DIR}/install.sh" ]; then
|
if [ -f "${SCRIPT_DIR}/install.sh" ]; then
|
||||||
|
@@ -327,7 +327,7 @@ fi
|
|||||||
|
|
||||||
# Check if we're being called to show version
|
# Check if we're being called to show version
|
||||||
if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ] || [ "$1" = "v" ]; then
|
if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ] || [ "$1" = "v" ]; then
|
||||||
echo "2025.0803.0612"
|
echo "__VERSION__"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user