From 705c6b6a0ea2b4cf9a4cf0d0e0b9f68758dc07d0 Mon Sep 17 00:00:00 2001 From: TheRaiwy Date: Fri, 10 Jul 2026 13:05:49 +0300 Subject: [PATCH] Auto-create release after successful tests --- .gitea/workflows/test.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 3ab5cd9..b7f50ef 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -14,3 +14,23 @@ jobs: - name: Run unit tests run: python3 tests/test_parse.py + + release: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Create release + env: + GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG="v$(date -u +%Y%m%d-%H%M%S)" + API="https://gittheraiwy.theraiwy.top/api/v1/repos/${{ github.repository }}/releases" + BODY="Automated release from commit ${{ github.sha }}" + echo "Creating release $TAG ..." + curl -sS -X POST "$API" \ + -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"$BODY\"}" || exit 1