[ci] Fix package upload
This commit is contained in:
@ -87,13 +87,15 @@ jobs:
|
||||
ASSET=$(ls dist/Mopidy_*.tar.gz dist/Mopidy-*.tar.gz 2>/dev/null | head -1)
|
||||
API="http://gitea.service:3000/api/v1/repos/secstate/Iris"
|
||||
|
||||
# Delete old continuous tag/release if exists
|
||||
curl -sf -X DELETE "${API}/tags/continuous" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" || true
|
||||
curl -sf "${API}/releases/tags/continuous" \
|
||||
# Delete old release first (by tag lookup), then delete the tag
|
||||
OLD_ID=$(curl -sf "${API}/releases/tags/continuous" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
| python3 -c "import sys,json;print(json.load(sys.stdin).get('id',''))" 2>/dev/null \
|
||||
| xargs -I{} curl -sf -X DELETE "${API}/releases/{}" \
|
||||
| python3 -c "import sys,json;print(json.load(sys.stdin).get('id',''))" 2>/dev/null)
|
||||
if [ -n "$OLD_ID" ]; then
|
||||
curl -sf -X DELETE "${API}/releases/${OLD_ID}" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" || true
|
||||
fi
|
||||
curl -sf -X DELETE "${API}/tags/continuous" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" || true
|
||||
|
||||
# Create release and upload asset
|
||||
|
||||
Reference in New Issue
Block a user