From f2e8b4336f3a7b057913d88cae913ba8ffd5d3f7 Mon Sep 17 00:00:00 2001 From: bigjakk Date: Fri, 3 Apr 2026 17:00:55 -0700 Subject: [PATCH] fix(ci): use curl instead of gh CLI for release creation --- .github/workflows/build-release.yml | 35 ++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 6f25a9b..ec1c3fa 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -77,19 +77,42 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG: ${{ steps.version-check.outputs.TAG }} run: | + API="https://api.github.com/repos/${{ github.repository }}" + AUTH="Authorization: Bearer $GITHUB_TOKEN" + # Create release - gh release create "$TAG" \ - --repo "${{ github.repository }}" \ - --title "$TAG" \ - --notes "Automated build for $TAG" \ - --latest + RESPONSE=$(curl -s -X POST "$API/releases" \ + -H "$AUTH" \ + -H "Content-Type: application/json" \ + -d "{ + \"tag_name\": \"$TAG\", + \"name\": \"$TAG\", + \"body\": \"Automated build for $TAG\", + \"draft\": false, + \"prerelease\": false + }") + + RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id') + UPLOAD_URL=$(echo "$RESPONSE" | jq -r '.upload_url' | sed 's/{?name,label}//') + echo "Created release ID: $RELEASE_ID" + + if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then + echo "Failed to create release:" + echo "$RESPONSE" + exit 1 + fi # Upload all built artifacts for file in out/*.exe out/*.AppImage out/*.deb; do [ -f "$file" ] || continue FILENAME=$(basename "$file") + MIME="application/octet-stream" echo "Uploading: $FILENAME ($(du -h "$file" | cut -f1))" - gh release upload "$TAG" "$file" --repo "${{ github.repository }}" + curl -s -X POST "${UPLOAD_URL}?name=${FILENAME}" \ + -H "$AUTH" \ + -H "Content-Type: $MIME" \ + --data-binary "@$file" \ + | jq -r '" -> \(.name) (\(.size) bytes)"' done echo "All assets uploaded"