Add 1 and update 2 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 9s
Build-Test-Publish / build (linux/arm64) (push) Failing after 10s

This commit is contained in:
Your Name
2025-08-17 21:49:07 +12:00
parent fbafdb0b61
commit 4e5253f1a3
3 changed files with 105 additions and 10 deletions

View File

@@ -17,22 +17,28 @@ function heading() {
#--------------------------------------------------------------------------------
heading "Publishing ${PROJECT} as tool to ${PROJECT}:${ARCH} (on getpkg.xyz)"
# Generate version timestamp
VERSION=$(date -u +"%Y.%m%d.%H%M")
# Update version in the main sos script
echo "Updating version in main ${PROJECT} script to ${VERSION}..."
sed -i "s/^VERSION=\".*\"/VERSION=\"${VERSION}\"/" "${SCRIPT_DIR}/${PROJECT}"
# Copy the tool to the tool directory
TOOLDIR="${SCRIPT_DIR}/tool"
mkdir -p "${TOOLDIR}"
cp "${SCRIPT_DIR}/${PROJECT}" "${TOOLDIR}/${PROJECT}"
# Replace version placeholder with actual timestamp
VERSION=$(date -u +"%Y.%m%d.%H%M")
sed -i "s/__VERSION_PLACEHOLDER__/${VERSION}/g" "${TOOLDIR}/${PROJECT}"
# Print the version of the tool
echo "Version of the tool:"
"${TOOLDIR}/${PROJECT}" version
# Use getpkg to publish the tool
GETPKG="${SCRIPT_DIR}/../getpkg/output/getpkg"
# Use getpkg to publish the tool - check standard location first
GETPKG="${HOME}/.local/bin/getpkg/getpkg"
if [ ! -f "$GETPKG" ]; then
GETPKG="${SCRIPT_DIR}/../getpkg/output/getpkg"
fi
if [ ! -f "$GETPKG" ]; then
GETPKG="${SCRIPT_DIR}/../getpkg/getpkg"
fi