dropshell release 2025.0526.2234
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 2m47s

This commit is contained in:
Your Name 2025-05-26 22:34:52 +12:00
parent 8eb652b84e
commit 84fd96e74e

View File

@ -6,16 +6,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "Script directory: $SCRIPT_DIR" echo "Script directory: $SCRIPT_DIR"
# Check for GITEA_TOKEN_DEPLOY or GITEA_TOKEN # Check for GITEA_TOKEN_DEPLOY or GITEA_TOKEN
if [ -n "$GITEA_TOKEN_DEPLOY" ]; then TOKEN="${GITEA_TOKEN_DEPLOY:-${GITEA_TOKEN}}"
TOKEN="$GITEA_TOKEN_DEPLOY" [ -z "$TOKEN" ] && { echo "Neither GITEA_TOKEN_DEPLOY nor GITEA_TOKEN environment variable set!" >&2; exit 1; }
echo "Using GITEA_TOKEN_DEPLOY"
elif [ -n "$GITEA_TOKEN" ]; then
TOKEN="$GITEA_TOKEN"
echo "Using GITEA_TOKEN"
else
echo "Neither GITEA_TOKEN_DEPLOY nor GITEA_TOKEN environment variable set!" >&2
exit 1
fi
$SCRIPT_DIR/multibuild.sh $SCRIPT_DIR/multibuild.sh
BUILD_DIR=$SCRIPT_DIR/build BUILD_DIR=$SCRIPT_DIR/build
@ -23,18 +15,15 @@ BUILD_DIR=$SCRIPT_DIR/build
OLD_PWD=$PWD OLD_PWD=$PWD
cd $SCRIPT_DIR cd $SCRIPT_DIR
# Check for required binaries
if [ ! -f "output/dropshell.x86_64" ]; then REQUIRED_BINARIES=("dropshell.x86_64" "dropshell.aarch64")
echo "output/dropshell.x86_64 not found!" >&2 for binary in "${REQUIRED_BINARIES[@]}"; do
if [ ! -f "output/$binary" ]; then
echo "output/$binary not found!" >&2
echo "Please run multibuild.sh first." >&2 echo "Please run multibuild.sh first." >&2
exit 1 exit 1
fi fi
done
if [ ! -f "output/dropshell.aarch64" ]; then
echo "output/dropshell.aarch64 not found!" >&2
echo "Please run multibuild.sh first." >&2
exit 1
fi
TAG=$("$SCRIPT_DIR/output/dropshell.x86_64" --version) TAG=$("$SCRIPT_DIR/output/dropshell.x86_64" --version)
[ -z "$TAG" ] && echo "Failed to get version from dropshell.x86_64" >&2 && exit 1 [ -z "$TAG" ] && echo "Failed to get version from dropshell.x86_64" >&2 && exit 1
@ -89,23 +78,35 @@ if [ -z "$RELEASE_ID" ]; then
exit 1 exit 1
fi fi
# 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
}
# Upload binaries and install.sh # Upload binaries and install.sh
for FILE in dropshell.x86_64 dropshell.aarch64 install.sh server_autosetup.sh; do for FILE in dropshell.x86_64 dropshell.aarch64 install.sh server_autosetup.sh; do
if [ -f "output/$FILE" ]; then # Pass the locations directly to the find_file function
filetoupload="output/$FILE" filetoupload=$(find_file "$FILE" "output" "../" ".")
elif [ -f "../$FILE" ]; then if [ -z "$filetoupload" ]; then
filetoupload="../$FILE" echo "File $FILE not found in expected locations!" >&2
elif [ -f "$FILE" ]; then
filetoupload="$FILE"
else
echo "File $FILE not found!" >&2
continue continue
fi fi
# Auto-detect content type # Auto-detect content type
ctype=$(file --mime-type -b "$filetoupload") ctype=$(file --mime-type -b "$filetoupload")
curl -s -X POST "$API_URL/releases/$RELEASE_ID/assets?name=$FILE" \ curl -X POST "$API_URL/releases/$RELEASE_ID/assets?name=$FILE" \
-H "Content-Type: $ctype" \ -H "Content-Type: $ctype" \
-H "Authorization: token $TOKEN" \ -H "Authorization: token $TOKEN" \
--data-binary @"$filetoupload" --data-binary @"$filetoupload"