fix: use token query param and form-data upload per Gitea API spec
Release / build-and-release (push) Failing after 58s
Release / build-and-release (push) Failing after 58s
This commit is contained in:
@@ -68,10 +68,9 @@ jobs:
|
|||||||
TAG="${{ gitea.ref_name }}"
|
TAG="${{ gitea.ref_name }}"
|
||||||
|
|
||||||
RELEASE_RESP=$(curl -s -X POST \
|
RELEASE_RESP=$(curl -s -X POST \
|
||||||
-u "token:$TOKEN" \
|
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"Release $TAG\",\"draft\":false,\"prerelease\":false}" \
|
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"Release $TAG\",\"draft\":false,\"prerelease\":false}" \
|
||||||
"$API/repos/$REPO/releases")
|
"$API/repos/$REPO/releases?token=$TOKEN")
|
||||||
echo "Release response: $RELEASE_RESP"
|
echo "Release response: $RELEASE_RESP"
|
||||||
|
|
||||||
RELEASE_ID=$(echo "$RELEASE_RESP" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
|
RELEASE_ID=$(echo "$RELEASE_RESP" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
|
||||||
@@ -85,10 +84,8 @@ jobs:
|
|||||||
for FILE in wgrplane-linux-amd64 wgrplane-linux-arm64 latest.json; do
|
for FILE in wgrplane-linux-amd64 wgrplane-linux-arm64 latest.json; do
|
||||||
echo "Uploading $FILE..."
|
echo "Uploading $FILE..."
|
||||||
curl -s -X POST \
|
curl -s -X POST \
|
||||||
-u "token:$TOKEN" \
|
-F "attachment=@$FILE" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=$FILE&token=$TOKEN"
|
||||||
--data-binary @"$FILE" \
|
|
||||||
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=$FILE"
|
|
||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user