Modify bb64/publish.sh
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 24s
Build-Test-Publish / build (linux/arm64) (push) Failing after 27s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 24s
Build-Test-Publish / build (linux/arm64) (push) Failing after 27s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
This commit is contained in:
parent
44d4af498f
commit
abcd1c07c3
@ -77,34 +77,52 @@ if [ -z "$DOCKER_PUSH_TOKEN" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RELEASE_ID=$(curl -s -X POST "$API_URL/releases" \
|
||||
echo "Creating release $TAG on Gitea..."
|
||||
RELEASE_RESPONSE=$(curl -s -X POST "$API_URL/releases" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: token $DOCKER_PUSH_TOKEN" \
|
||||
-d "$RELEASE_DATA" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
-d "$RELEASE_DATA")
|
||||
|
||||
echo "Release API response: $RELEASE_RESPONSE"
|
||||
|
||||
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
|
||||
if [ -z "$RELEASE_ID" ]; then
|
||||
echo "Failed to create release on Gitea." >&2
|
||||
echo "API URL: $API_URL/releases" >&2
|
||||
echo "Release data: $RELEASE_DATA" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Created release with ID: $RELEASE_ID"
|
||||
|
||||
# Upload binaries and install.sh
|
||||
echo "Uploading assets to release..."
|
||||
for FILE in ${PROJECT}.${ARCH_ALIAS} ${PROJECT}.${ARCH} install.sh; do
|
||||
if [ -f "output/$FILE" ]; then
|
||||
filetoupload="output/$FILE"
|
||||
elif [ -f "$FILE" ]; then
|
||||
filetoupload="$FILE"
|
||||
else
|
||||
echo "Skipping $FILE - not found"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Uploading $filetoupload as $FILE..."
|
||||
# Auto-detect content type
|
||||
ctype=$(file --mime-type -b "$filetoupload")
|
||||
|
||||
curl -s -X POST "$API_URL/releases/$RELEASE_ID/assets?name=$FILE" \
|
||||
UPLOAD_RESPONSE=$(curl -s -X POST "$API_URL/releases/$RELEASE_ID/assets?name=$FILE" \
|
||||
-H "Content-Type: $ctype" \
|
||||
-H "Authorization: token $DOCKER_PUSH_TOKEN" \
|
||||
--data-binary @"$filetoupload"
|
||||
echo "Uploaded $FILE to release $TAG as $ctype."
|
||||
--data-binary @"$filetoupload")
|
||||
|
||||
if echo "$UPLOAD_RESPONSE" | grep -q '"id"'; then
|
||||
echo "✓ Uploaded $FILE to release $TAG as $ctype."
|
||||
else
|
||||
echo "✗ Failed to upload $FILE. Response: $UPLOAD_RESPONSE" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Published bb64 version $v to $REPO_URL (tag $TAG) with binaries for $ARCH_ALIAS / $ARCH."
|
||||
@ -125,7 +143,15 @@ if [ ! -f "$GETPKG" ]; then
|
||||
fi
|
||||
|
||||
if [ -f "$GETPKG" ]; then
|
||||
"${GETPKG}" publish "${PROJECT}:${ARCH}" "${TOOLDIR}"
|
||||
echo "Publishing ${PROJECT} to getpkg.xyz using ${GETPKG}..."
|
||||
if "${GETPKG}" publish "${PROJECT}:${ARCH}" "${TOOLDIR}"; then
|
||||
echo "✓ Successfully published ${PROJECT} to getpkg.xyz"
|
||||
else
|
||||
echo "✗ Failed to publish ${PROJECT} to getpkg.xyz" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Warning: getpkg not found, skipping tool publishing to getpkg.xyz"
|
||||
echo "Warning: getpkg not found at $GETPKG, skipping tool publishing to getpkg.xyz"
|
||||
fi
|
||||
|
||||
echo "✓ BB64 publish script completed successfully"
|
||||
|
Loading…
x
Reference in New Issue
Block a user