This commit is contained in:
@ -4,29 +4,16 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
SOS="${TEMP_DIR}/sos"
|
||||
|
||||
curl -L -o "${SOS}" https://getbin.xyz/sos
|
||||
chmod +x "${SOS}"
|
||||
function getbin() {
|
||||
local BIN_NAME="$1"
|
||||
|
||||
curl -L -o "${TEMP_DIR}/${BIN_NAME}" "https://getbin.xyz/${BIN_NAME}"
|
||||
chmod +x "${TEMP_DIR}/${BIN_NAME}"
|
||||
}
|
||||
|
||||
getbin "dropshell-build"
|
||||
|
||||
"${TEMP_DIR}/dropshell-build" "${SCRIPT_DIR}"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# make canonical path
|
||||
DROPSHELL_BUILD_DIR=$(realpath "${DROPSHELL_BUILD_DIR}")
|
||||
|
||||
# make sure the build script exists
|
||||
if [ ! -f "${DROPSHELL_BUILD_DIR}/dropshell-build" ]; then
|
||||
echo "Error: dropshell-build not found"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "${DROPSHELL_BUILD_DIR}/install_dropshell_build_requirements" ]; then
|
||||
echo "Error: install_dropshell_build_requirements not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# run the build script
|
||||
"${DROPSHELL_BUILD_DIR}/dropshell-build" -m -r "${SCRIPT_DIR}"
|
||||
rm -rf "${TEMP_DIR}"
|
||||
|
@ -3,6 +3,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
|
||||
|
||||
die() {
|
||||
@ -10,14 +11,19 @@ die() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
function publish_install() {
|
||||
function publish_tool() {
|
||||
local TOOLPATH="$1"
|
||||
local ARCH="$2"
|
||||
local TOOL;
|
||||
TOOL=$(basename "$TOOLPATH")
|
||||
|
||||
"${SCRIPT_DIR}/../sos/sos" upload "getbin.xyz" "dropshell-tool-install" "dropshell-tool-install"
|
||||
echo "Publishing $TOOL to getbin.xyz"
|
||||
|
||||
"${TEMP_DIR}/sos" upload "getbin.xyz" "$TOOL" "$TOOLPATH"
|
||||
}
|
||||
|
||||
function publish_executables() {
|
||||
OUTPUT_DIR="${SCRIPT_DIR}/output"
|
||||
ARCH=$(uname -m)
|
||||
|
||||
# Find all dropshell-tool.ARCH files in output/
|
||||
TOOLS=()
|
||||
@ -33,7 +39,7 @@ function publish_executables() {
|
||||
fi
|
||||
|
||||
for TOOL in "${TOOLS[@]}"; do
|
||||
echo "Publishing $TOOL"
|
||||
publish_tool "$TOOL" "${TOOL//dropshell-tool./}"
|
||||
|
||||
# extract the architecture from the tool name
|
||||
ARCH="${TOOL//dropshell-tool./}"
|
||||
@ -44,7 +50,17 @@ function publish_executables() {
|
||||
|
||||
}
|
||||
|
||||
publish_install
|
||||
function getbin() {
|
||||
local BIN_NAME="$1"
|
||||
|
||||
curl -L -o "${TEMP_DIR}/${BIN_NAME}" "https://getbin.xyz/${BIN_NAME}"
|
||||
chmod +x "${TEMP_DIR}/${BIN_NAME}"
|
||||
}
|
||||
|
||||
|
||||
|
||||
getbin "sos"
|
||||
publish_executables
|
||||
|
||||
rm -rf "${TEMP_DIR}"
|
||||
echo "Done"
|
Reference in New Issue
Block a user