'Generic Commit'
Some checks failed
dropshell-build / build (push) Has been cancelled

This commit is contained in:
Your Name
2025-05-31 22:02:26 +12:00
parent 3f27cbf155
commit 4b7ec3cacf
13 changed files with 96 additions and 41 deletions

View File

@ -3,7 +3,7 @@ set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
DROPSHELL_BUILD_DIR="${SCRIPT_DIR}/../dropshell-build/"
DROPSHELL_BUILD_DIR="${SCRIPT_DIR}/../dropshell-build/src"
# make canonical path
DROPSHELL_BUILD_DIR=$(realpath "${DROPSHELL_BUILD_DIR}")
@ -17,9 +17,5 @@ if [ ! -f "${DROPSHELL_BUILD_DIR}/install_dropshell_build_requirements" ]; then
exit 1
fi
# install host dependencies
"${DROPSHELL_BUILD_DIR}/install_dropshell_build_requirements"
# run the build script
"${DROPSHELL_BUILD_DIR}/dropshell-build" "$@" "${SCRIPT_DIR}"
"${DROPSHELL_BUILD_DIR}/dropshell-build" -m -r "${SCRIPT_DIR}"

View File

@ -0,0 +1,19 @@
#!/bin/bash
set -euo pipefail
#SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo "Installing dropshell-tool"
ARCH=$(uname -m)
wget "https://getbin.xyz/dropshell-tool:$ARCH" -O bootstrap && chmod a+x bootstrap
./bootstrap install dropshell tool
rm ./bootstrap
VERSION=$(dropshell-tool version)
echo "Dropshell tool $VERSION installed"

View File

@ -10,38 +10,41 @@ die() {
exit 1
}
MYARCH=$(uname -m)
function publish_install() {
"${SCRIPT_DIR}/../sos/sos" upload "getbin.xyz" "dropshell-tool-install" "dropshell-tool-install"
}
"${SCRIPT_DIR}/build.sh" -m -r || die "Failed to build"
function publish_executables() {
OUTPUT_DIR="${SCRIPT_DIR}/output"
ARCH=$(uname -m)
PUBLISH_DIR="${SCRIPT_DIR}/tool"
OUTPUT_DIR="${SCRIPT_DIR}/output"
# Find all dropshell-tool.ARCH files in output/
TOOLS=()
for tool in "${SCRIPT_DIR}/output/"/*dropshell-tool.*; do
[ -f "$tool" ] || continue
tool_name=$(basename "$tool")
TOOLS+=("$tool_name")
done
# Find all dropshell-tool.ARCH files in output/
TOOLS=()
for tool in "${SCRIPT_DIR}/output/"/*dropshell-tool.*; do
[ -f "$tool" ] || continue
tool_name=$(basename "$tool")
TOOLS+=("$tool_name")
done
if [ ${#TOOLS[@]} -eq 0 ]; then
echo "No tools found in ${SCRIPT_DIR}/output/. Exiting."
exit 1
fi
if [ ${#TOOLS[@]} -eq 0 ]; then
echo "No tools found in ${SCRIPT_DIR}/output/. Exiting."
exit 1
fi
for TOOL in "${TOOLS[@]}"; do
echo "Publishing $TOOL"
for TOOL in "${TOOLS[@]}"; do
echo "Publishing $TOOL"
# extract the architecture from the tool name
ARCH="${TOOL//dropshell-tool./}"
# extract the architecture from the tool name
ARCH="${TOOL//dropshell-tool./}"
# upload the tool
"${SCRIPT_DIR}/../sos/sos" upload "getbin.xyz" "dropshell-tool:${ARCH}" "$OUTPUT_DIR/$TOOL"
done
# copy the tool to the output/ directory
cp "$OUTPUT_DIR/$TOOL" "$PUBLISH_DIR/dropshell-tool" || die "Failed to copy $TOOL to $PUBLISH_DIR/dropshell-tool"
}
"$OUTPUT_DIR/dropshell-tool.${MYARCH}" publish "dropshell-tool:${ARCH}" "$PUBLISH_DIR" || die "Failed to publish $TOOL"
publish_install
publish_executables
# remove the tool from the output/ directory
rm "$PUBLISH_DIR/dropshell-tool" || die "Failed to remove $PUBLISH_DIR/dropshell-tool"
done
echo "Done"

14
dropshell-tool/test.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
MYARCH=$(uname -m)
VERSION=$("${SCRIPT_DIR}/output/dropshell-tool.${MYARCH}" version)
echo "Version: $VERSION"

View File

@ -1,4 +0,0 @@
{
"aliases": [],
"setup_script": "setup_script.sh"
}

View File

@ -1,2 +0,0 @@
#!/bin/bash
echo 'Setup complete.'