From ca75a8842dcbefcab10a74cd47f5b498ff43be06 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sun, 28 Jun 2026 13:12:51 -0400 Subject: [PATCH] [ci] Upload builds too --- .gitea/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0ef2d361..5314d0ac 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -74,6 +74,34 @@ jobs: pip install --break-system-packages build python -m build --sdist + - name: Upload sdist to Gitea release + continue-on-error: true + env: + GITEA_TOKEN: ${{ secrets.GITEA }} + run: | + VERSION=$(cat IRIS_VERSION) + 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" \ + -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/{}" \ + -H "Authorization: token ${GITEA_TOKEN}" || true + + # Create release and upload asset + RELEASE_ID=$(curl -sf -X POST "${API}/releases" \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -d '{"tag_name":"continuous","name":"Continuous build","prerelease":true,"target_commitish":"main"}' \ + | python3 -c "import sys,json;print(json.load(sys.stdin)['id'])") + curl -sf -X POST "${API}/releases/${RELEASE_ID}/assets" \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -F "attachment=@${ASSET}" + - name: Copy sdist to server uses: appleboy/scp-action@v0.1.7 with: