ci: replace release-action with curl (no go/action dep, fewer moving parts)

This commit is contained in:
2026-05-25 11:56:56 +02:00
parent adccfdec30
commit 84f045c724
+29 -5
View File
@@ -18,8 +18,32 @@ jobs:
- name: Build per-addon zip(s) - name: Build per-addon zip(s)
run: bash tools/build_zip.sh run: bash tools/build_zip.sh
- name: Publish release - name: Publish release (Gitea API direct; no action dependency)
uses: https://gitea.com/actions/release-action@main env:
with: GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
files: dist/*.zip REPO: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }} # auto-injected per job; no org secret needed TAG: ${{ github.ref_name }}
API: ${{ github.server_url }}/api/v1
run: |
set -euo pipefail
# Create the release (or reuse if it already exists for this tag).
RID=$(curl -sf -H "Authorization: token $GITEA_TOKEN" \
"$API/repos/$REPO/releases/tags/$TAG" 2>/dev/null \
| jq -r '.id // empty')
if [ -z "$RID" ]; then
RID=$(curl -sf -X POST -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
"$API/repos/$REPO/releases" \
-d "$(jq -nc --arg t "$TAG" '{tag_name:$t,name:$t,draft:false,prerelease:false}')" \
| jq -r '.id')
fi
echo "release id: $RID"
# Upload every dist/*.zip
for f in dist/*.zip; do
name=$(basename "$f")
echo "uploading $name"
curl -sf -X POST -H "Authorization: token $GITEA_TOKEN" \
-F "attachment=@$f" \
"$API/repos/$REPO/releases/$RID/assets?name=$name" \
| jq -r '" -> " + .browser_download_url'
done