From 12c0603966b2e1b766bcc400b821d862806945b0 Mon Sep 17 00:00:00 2001 From: magerbeton Date: Sun, 23 Aug 2026 17:05:03 +0200 Subject: [PATCH] ci: drop actions/upload-artifact, tolerate existing releases upload-artifact@v4 talks to GitHub's artifact service and times out on Gitea. Distribution happens via release assets anyway. Also reuse an existing release for a tag instead of failing on a 409. --- .gitea/workflows/release.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 17becd9..9603e68 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -39,11 +39,6 @@ jobs: for f in tea-*; do sha256sum "$f" > "$f.sha256" done - - uses: actions/upload-artifact@v4 - with: - name: tea-binaries - path: dist/* - if-no-files-found: error - name: create release + upload assets env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} @@ -51,12 +46,17 @@ jobs: set -e TAG="${GITHUB_REF_NAME}" API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" - RESPONSE="$(curl -sf -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Content-Type: application/json" \ - "${API}/releases" \ - -d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\"}")" - RELEASE_ID="$(printf '%s' "$RESPONSE" | python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])')" + RELEASE_ID="$(curl -sf -H "Authorization: token ${GITEA_TOKEN}" \ + "${API}/releases/tags/${TAG}" \ + | python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])' || true)" + if [ -z "$RELEASE_ID" ]; then + RESPONSE="$(curl -sf -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + "${API}/releases" \ + -d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\"}")" + RELEASE_ID="$(printf '%s' "$RESPONSE" | python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])')" + fi for f in dist/tea-*; do curl -sf -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \