From 7de3e9287120604fc333b720f1e419c042811063 Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Fri, 28 Aug 2026 13:06:26 +0200 Subject: [PATCH 1/4] ci: give automated commits visible checks, scope CI triggers, publish releases - Drop [skip ci] from the bump-version/changelog/tag-sync commits so master's tip always has a check run instead of only the merge commit. - Filter those chore commits out of the changelog via message pattern instead of the now-removed [skip ci] tag. - Only run CI on push to master (plus tags); pull requests to any branch still run the full suite. - Add a publish-package job that builds and publishes to the Gitea PyPI registry on every tag push, after tests and version sync pass. --- .bumpversion.toml | 2 +- .gitea/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++---- cliff.toml | 2 +- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 2ff89ab..e4b6628 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -8,7 +8,7 @@ regex = false allow_dirty = false commit = true tag = false -message = "chore: bump version {current_version} -> {new_version} [skip ci]" +message = "chore: bump version {current_version} -> {new_version}" pre_commit_hooks = ["uv lock", "git add uv.lock"] [[tool.bumpversion.files]] diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 1f62d7c..34b4d17 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,10 +2,9 @@ name: CI "on": push: - branches: ["**"] + branches: ["master"] tags: ["**"] pull_request: - branches: [master] env: UV_CACHE_DIR: /uv-cache @@ -156,7 +155,7 @@ jobs: uv run git-cliff --tag "$TAG" --unreleased --prepend CHANGELOG.md git add CHANGELOG.md if ! git diff --cached --quiet -- CHANGELOG.md; then - git commit -m "chore: update changelog for $TAG [skip ci]" + git commit -m "chore: update changelog for $TAG" else git restore --staged CHANGELOG.md fi @@ -193,7 +192,7 @@ jobs: git config user.name "gitea-actions" git config user.email "actions@git.larsbogner.de" git add pyproject.toml uv.lock - git commit -m "chore: sync project version to tag ${GITHUB_REF_NAME} [skip ci]" + git commit -m "chore: sync project version to tag ${GITHUB_REF_NAME}" git push origin HEAD:master git push origin ":refs/tags/${GITHUB_REF_NAME}" git tag -f "${GITHUB_REF_NAME}" HEAD @@ -201,3 +200,33 @@ jobs: else echo "Tag version matches project version ($CURRENT_VERSION)" fi + + publish-package: + name: Publish package to Gitea package registry + needs: [ruff-check, ruff-format, type-check, test, sync-version-on-tag] + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + container: + image: docker.gitea.com/runner-images:ubuntu-latest + volumes: + - /srv/act-runner-cache/uv:/uv-cache + steps: + # Check out by tag name (not the triggering SHA) since sync-version-on-tag + # may have force-moved the tag to a version-corrected commit. + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + - uses: astral-sh/setup-uv@v5 + with: + enable-cache: false + - run: | + echo "UV_CACHE_DIR=/uv-cache" >> "$GITHUB_ENV" + echo "UV_LINK_MODE=copy" >> "$GITHUB_ENV" + - run: uv build + # CI_TOKEN needs write:package scope (in addition to write:repository, + # used elsewhere) for this upload to authenticate. + - run: | + uv publish \ + --publish-url "https://git.larsbogner.de/api/packages/lars/pypi" \ + --username gitea-actions \ + --password "${{ secrets.CI_TOKEN }}" diff --git a/cliff.toml b/cliff.toml index bca7fc8..7207e63 100644 --- a/cliff.toml +++ b/cliff.toml @@ -37,7 +37,7 @@ commit_preprocessors = [ protect_breaking_commits = false commit_parsers = [ { message = "^Merge ", skip = true }, - { message = "\\[skip ci\\]", skip = true }, + { message = "^chore: (bump version|update changelog|sync project version)", skip = true }, { message = "^Add", group = "Added" }, { message = "^(Fix|Clamp|Clip)", group = "Fixed" }, { message = "^(Remove|Drop|Deprecate)", group = "Removed" }, From cc11efb3aee4ef1b83ea53fc74b6707fa07dc88d Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Fri, 28 Aug 2026 13:08:25 +0200 Subject: [PATCH 2/4] ci: fix pull_request trigger not registering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A bare "pull_request:" key parses to null in YAML, which the runner apparently doesn't treat as "trigger with defaults" the way an empty mapping does — the open PR for this branch got no CI run at all. --- .gitea/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 34b4d17..2177252 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -4,7 +4,7 @@ name: CI push: branches: ["master"] tags: ["**"] - pull_request: + pull_request: {} env: UV_CACHE_DIR: /uv-cache From e06d9e9581bc7f1d0740a7bfab53fde572ea086f Mon Sep 17 00:00:00 2001 From: gitea-actions Date: Fri, 28 Aug 2026 11:18:49 +0000 Subject: [PATCH 3/4] chore: bump version 0.3.13 -> 0.3.14 --- .bumpversion.toml | 2 +- pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index e4b6628..fda2244 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.3.13" +current_version = "0.3.14" parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" serialize = ["{major}.{minor}.{patch}"] search = "{current_version}" diff --git a/pyproject.toml b/pyproject.toml index b79664d..820eee3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "giant" -version = "0.3.13" +version = "0.3.14" description = "Geant4 step-function surrogate via conditional flow matching" readme = "README.md" requires-python = ">=3.12" diff --git a/uv.lock b/uv.lock index d650671..f081e58 100644 --- a/uv.lock +++ b/uv.lock @@ -675,7 +675,7 @@ wheels = [ [[package]] name = "giant" -version = "0.3.13" +version = "0.3.14" source = { editable = "." } dependencies = [ { name = "numpy" }, From c12acfdade3ca55c167fee46666da6cab94832cd Mon Sep 17 00:00:00 2001 From: gitea-actions Date: Fri, 28 Aug 2026 11:19:14 +0000 Subject: [PATCH 4/4] chore: update changelog for v0.3.14 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3e4ecd..777f139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.3.14] - 2026-08-28 + +### Changed + +- Ci: give automated commits visible checks, scope CI triggers, publish releases + +- Ci: fix pull_request trigger not registering + ## [0.3.13] - 2026-08-28 ### Added