ci: drop actions/upload-artifact, tolerate existing releases
release / release (push) Canceled after 27h55m13s

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.
This commit is contained in:
2026-08-23 17:05:03 +02:00
parent df6e626533
commit 12c0603966
+11 -11
View File
@@ -39,11 +39,6 @@ jobs:
for f in tea-*; do for f in tea-*; do
sha256sum "$f" > "$f.sha256" sha256sum "$f" > "$f.sha256"
done done
- uses: actions/upload-artifact@v4
with:
name: tea-binaries
path: dist/*
if-no-files-found: error
- name: create release + upload assets - name: create release + upload assets
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
@@ -51,12 +46,17 @@ jobs:
set -e set -e
TAG="${GITHUB_REF_NAME}" TAG="${GITHUB_REF_NAME}"
API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
RESPONSE="$(curl -sf -X POST \ RELEASE_ID="$(curl -sf -H "Authorization: token ${GITEA_TOKEN}" \
-H "Authorization: token ${GITEA_TOKEN}" \ "${API}/releases/tags/${TAG}" \
-H "Content-Type: application/json" \ | python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])' || true)"
"${API}/releases" \ if [ -z "$RELEASE_ID" ]; then
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\"}")" RESPONSE="$(curl -sf -X POST \
RELEASE_ID="$(printf '%s' "$RESPONSE" | python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])')" -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 for f in dist/tea-*; do
curl -sf -X POST \ curl -sf -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \ -H "Authorization: token ${GITEA_TOKEN}" \