Auto-create release after successful tests
tests / test (push) Successful in 6s
tests / release (push) Successful in 6s

This commit is contained in:
TheRaiwy
2026-07-10 13:05:49 +03:00
parent 3dac157a4a
commit 705c6b6a0e
+20
View File
@@ -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