diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 7194909..b41afa2 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -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