From 8846e2d95a7581373a538e9cbf3328a7584597d6 Mon Sep 17 00:00:00 2001 From: Dasemu Date: Sun, 18 Oct 2026 21:49:38 +0200 Subject: [PATCH] feat(ci): create Gitea release on main bump and GitHub release on v* tags Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/version.yml | 16 ++++++++++++++++ .github/workflows/release.yml | 19 +++++++++++++++++++ CLAUDE.md | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.gitea/workflows/version.yml b/.gitea/workflows/version.yml index 61134c7..05482a2 100644 --- a/.gitea/workflows/version.yml +++ b/.gitea/workflows/version.yml @@ -71,3 +71,19 @@ jobs: git checkout development git merge --no-edit origin/main git push origin development + + - name: Create Gitea release + if: github.ref_name == 'main' + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tag="v${{ steps.version.outputs.new }}" + prev=$(git describe --tags --abbrev=0 --match 'v*' 2>/dev/null || true) + if [ -n "$prev" ]; then range="$prev..HEAD"; else range="HEAD"; fi + notes=$(git log "$range" --pretty='- %s' | grep -v 'chore(release)' || true) + jq -n --arg tag "$tag" --arg sha "$(git rev-parse HEAD)" --arg body "$notes" \ + '{tag_name: $tag, target_commitish: $sha, name: $tag, body: $body}' > release.json + curl -fsS -X POST \ + -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \ + -d @release.json \ + "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3d5541f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Release + +# Gitea creates the vX.Y.Z tag and release; this runs where that tag is mirrored. +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create GitHub release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --generate-notes --verify-tag diff --git a/CLAUDE.md b/CLAUDE.md index 777bbb1..f53fe52 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,7 +24,7 @@ FastAPI backend under `backend/` (API routers in `backend/api`, core services in - No backend linter/formatter (ruff/black/flake8) and no automated test suite (pytest/vitest) are configured yet. Do not assume `npm run lint` passes — it has no config. - Single `frontend/package.json` version field; there is no root `package.json`/`pyproject.toml`, so the release workflow tracks the version in the root `VERSION` file. -- CI runs on both Gitea (`.gitea/workflows/ci.yml`) and GitHub (`.github/workflows/ci.yml`); keep them in sync. Versioning (`version.yml`) exists only under `.gitea/workflows/`. +- CI runs on both Gitea (`.gitea/workflows/ci.yml`) and GitHub (`.github/workflows/ci.yml`); keep them in sync. Versioning and the Gitea release (`version.yml`) exist only under `.gitea/workflows/`; the GitHub release (`.github/workflows/release.yml`) is created when the `v*` tag reaches GitHub. ## Deployment Not yet documented here; no deployment workflow exists in this repo.