hopefully fix mess from llm assisted api calls

This commit is contained in:
2025-08-02 17:35:52 -04:00
parent f45342e379
commit 6b87c9e688

View File

@@ -16,6 +16,12 @@ ARCHIVE_NAME="X11Proxy-${VERSION}-linux-x86_64.tar.gz"
REPO="ezterry/X11Proxy" REPO="ezterry/X11Proxy"
GITEA_URL="https://git-hojo.devnull.name" GITEA_URL="https://git-hojo.devnull.name"
if [[ -z "$VERSION" ]]; then
echo "❌ Failed to extract version from main.go"
echo "please fix the version constant in main.go"
exit 1
fi
echo "$BIN_NAME build script (version: $VERSION)" echo "$BIN_NAME build script (version: $VERSION)"
# 🧹 Clean build artifacts # 🧹 Clean build artifacts
@@ -44,6 +50,12 @@ build_dist() {
# 🚀 Publish release to Gitea # 🚀 Publish release to Gitea
publish_release() { publish_release() {
#verify we will not run into an issue from a missing jq command
command -v jq >/dev/null || {
echo "❌ 'jq' is required but not installed. Please install it to continue."
exit 1
}
build_dist build_dist
echo "🔐 Enter Gitea token (will not be saved):" echo "🔐 Enter Gitea token (will not be saved):"
@@ -59,7 +71,7 @@ publish_release() {
git push origin $TAG git push origin $TAG
echo "📤 Creating release on Gitea..." echo "📤 Creating release on Gitea..."
curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/releases" \ RELEASE_JSON=$(curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \ -H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d @- <<EOF -d @- <<EOF
@@ -71,21 +83,9 @@ publish_release() {
"prerelease": false "prerelease": false
} }
EOF EOF
)
echo "📎 Uploading asset..." RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id')
RELEASE_ID=$(curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"tag_name": "${TAG}",
"name": "X11Proxy ${VERSION}",
"body": "Release ${VERSION}",
"draft": false,
"prerelease": false
}
EOF
| jq -r '.id')
echo "📎 Uploading asset to release ID ${RELEASE_ID}..." echo "📎 Uploading asset to release ID ${RELEASE_ID}..."
curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \ curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \
@@ -94,7 +94,6 @@ EOF
-F attachment=@"${ARCHIVE_NAME}" -F attachment=@"${ARCHIVE_NAME}"
echo "✅ Published release ${TAG} with asset ${ARCHIVE_NAME}" echo "✅ Published release ${TAG} with asset ${ARCHIVE_NAME}"
echo "📌 Remember to push the tag: git push origin ${TAG}"
} }
# 📖 Help message # 📖 Help message