fix: use Gitea API directly for release creation and asset upload
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ffbd1aea70
commit
b193bfe98e
|
|
@ -96,10 +96,25 @@ jobs:
|
|||
git diff --staged --quiet || git commit -m "chore: update manifest for ${{ github.ref_name }}"
|
||||
git push origin HEAD:${{ github.event.repository.default_branch }}
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: artifacts/**/*.zip
|
||||
overwrite: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Create release and upload assets
|
||||
run: |
|
||||
API="${{ github.server_url }}/api/v1"
|
||||
REPO="${{ github.repository }}"
|
||||
TAG="${{ github.ref_name }}"
|
||||
TOKEN="${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
# Create release (or get existing)
|
||||
RELEASE=$(curl -s -X POST "${API}/repos/${REPO}/releases" \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\"}")
|
||||
RELEASE_ID=$(echo "${RELEASE}" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||
|
||||
# Upload assets
|
||||
for file in artifacts/build-net9/*.zip artifacts/build-net10/*.zip; do
|
||||
NAME=$(basename "${file}")
|
||||
curl -s -X POST "${API}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${NAME}" \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary "@${file}"
|
||||
done
|
||||
|
|
|
|||
Loading…
Reference in New Issue