ci: drop actions/upload-artifact, tolerate existing releases
release / release (push) Canceled after 27h55m13s
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:
@@ -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}"
|
||||
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}" \
|
||||
|
||||
Reference in New Issue
Block a user