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
|
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}"
|
||||||
|
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 \
|
RESPONSE="$(curl -sf -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
"${API}/releases" \
|
"${API}/releases" \
|
||||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\"}")"
|
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\"}")"
|
||||||
RELEASE_ID="$(printf '%s' "$RESPONSE" | python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])')"
|
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}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user