docs: Add 6, update 4 and remove 2 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 59s
Build-Test-Publish / build (linux/arm64) (push) Failing after 2m45s

This commit is contained in:
j842
2025-08-17 21:01:38 +12:00
parent ed9bc9ba21
commit efd11657ac
12 changed files with 323 additions and 179 deletions

View File

@@ -1,57 +1,10 @@
#!/bin/bash
set -e
# directory of this script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "Script directory: $SCRIPT_DIR"
# Legacy publish script - redirects to new publish.sh in repository root
set -euo pipefail
# Check for GITEA_TOKEN_DEPLOY or GITEA_TOKEN
TOKEN="${RELEASE_WRITE_TOKEN:-${GITEA_TOKEN_DEPLOY}}"
[ -z "$TOKEN" ] && { echo "Neither RELEASE_WRITE_TOKEN nor GITEA_TOKEN_DEPLOY environment variable set!" >&2; exit 1; }
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PARENT_DIR="$(dirname "${SCRIPT_DIR}")"
OLD_PWD="$PWD"
cd "$SCRIPT_DIR" || exit 1
TEMP_DIR=$(mktemp -d)
trap 'rm -rf "$TEMP_DIR" && cd "$OLD_PWD"' EXIT
ARCH=$(uname -m)
TAG=$("$SCRIPT_DIR/output/dropshell.${ARCH}" --version)
[ -z "$TAG" ] && echo "Failed to get version from dropshell.${ARCH}" >&2 && exit 1
echo "Publishing dropshell version $TAG"
function die() {
echo "$@" >&2
exit 1
}
# Function to find file in specified locations
find_file() {
local filename="$1"
shift # remove filename from args
local locations=("$@") # grab the rest of the args as locations
for loc in "${locations[@]}"; do
if [ -f "$loc/$filename" ]; then
echo "$loc/$filename"
return 0 # Found the file, return success
fi
done
echo "" # Return empty string if not found
return 1
}
curl -L -s -o "${TEMP_DIR}/sos" "https://getbin.xyz/sos" || die "Failed to download sos"
chmod +x "${TEMP_DIR}/sos"
# Upload binaries and install.sh
for FILE in dropshell.x86_64 dropshell.aarch64 dropshell-install.sh dropshell-server-autosetup.sh; do
# Pass the locations directly to the find_file function
filetoupload=$(find_file "$FILE" "output" "../" ".")
[ -z "$filetoupload" ] && die "File $FILE not found in expected locations!"
"${TEMP_DIR}/sos" upload getbin.xyz "$filetoupload" "$FILE:latest" "$FILE:TAG"
done
echo "Published dropshell $TAG to getbin.xyz"
echo "Redirecting to new publish.sh in repository root..."
exec "${PARENT_DIR}/publish.sh" "$@"