docs: Add 6, update 4 and remove 2 files
This commit is contained in:
46
publish.sh
Executable file
46
publish.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
ARCH=$(uname -m)
|
||||
TEMP_DIR="${SCRIPT_DIR}/temp"
|
||||
SOS="${TEMP_DIR}/sos"
|
||||
PROJECT="dropshell"
|
||||
|
||||
echo "Publishing dropshell to getbin.xyz"
|
||||
|
||||
function die() {
|
||||
echo "error: $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ -n ${SOS_WRITE_TOKEN:-} ]] || die "SOS_WRITE_TOKEN not specified"
|
||||
|
||||
# clear output dir
|
||||
rm -rf "${SCRIPT_DIR}/output"
|
||||
mkdir -p "${SCRIPT_DIR}/output"
|
||||
|
||||
# build release version
|
||||
export CMAKE_BUILD_TYPE="Release"
|
||||
export INSTALL_LOCAL="false"
|
||||
"${SCRIPT_DIR}/build.sh"
|
||||
|
||||
[ -f "${SCRIPT_DIR}/output/dropshell" ] || die "Build failed."
|
||||
|
||||
# download the sos binary
|
||||
mkdir -p "${TEMP_DIR}"
|
||||
trap 'rm -rf "${TEMP_DIR}"' EXIT
|
||||
|
||||
curl -L -o "${SOS}" "https://getbin.xyz/sos"
|
||||
chmod +x "${SOS}"
|
||||
|
||||
# upload arch-specific binary
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/output/${PROJECT}" "${PROJECT}:latest-${ARCH}"
|
||||
|
||||
# upload generic install script
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/dropshell-install.sh" "dropshell-install:latest"
|
||||
|
||||
# upload server auto-setup script
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/dropshell-server-autosetup.sh" "dropshell-server-autosetup:latest"
|
||||
|
||||
echo "Successfully published dropshell:latest-${ARCH} to getbin.xyz"
|
Reference in New Issue
Block a user