Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
tags:
- "v*"
pull_request:
workflow_dispatch:

permissions:
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ name: Semantic Release

on:
workflow_dispatch:
inputs:
release_type:
description: "Version bump strategy"
required: true
default: auto
type: choice
options:
- auto
- patch
- minor
- major

permissions:
contents: write
Expand All @@ -21,6 +32,7 @@ jobs:
echo "ref=${GITHUB_REF}"
echo "actor=${GITHUB_ACTOR}"
echo "default_branch=${{ github.event.repository.default_branch }}"
echo "release_type=${{ github.event.inputs.release_type || 'auto' }}"

- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -49,7 +61,13 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: uv run --no-project --with python-semantic-release==9.21.1 semantic-release version
RELEASE_TYPE: ${{ github.event.inputs.release_type || 'auto' }}
run: |
if [ "${RELEASE_TYPE}" = "auto" ]; then
uv run --no-project --with python-semantic-release==9.21.1 semantic-release version --no-vcs-release
else
uv run --no-project --with python-semantic-release==9.21.1 semantic-release version --no-vcs-release --"${RELEASE_TYPE}"
fi

- name: Push release commit and tags
run: git push --follow-tags origin HEAD:${{ github.event.repository.default_branch }}
Expand All @@ -72,6 +90,7 @@ jobs:
if [ "${after_sha}" = "${{ steps.baseline.outputs.sha }}" ] && [ "${after_tag}" = "${{ steps.baseline.outputs.tag }}" ]; then
echo "released=false" >> "$GITHUB_OUTPUT"
echo "No new release generated in this run."
echo "Tip: use release_type=patch/minor/major to force a release when needed."
else
echo "released=true" >> "$GITHUB_OUTPUT"
echo "Release generated. Latest tag: ${after_tag:-none}"
Expand Down
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ Include:
- If commits qualify (`feat`, `fix`, `perf`, or breaking), version and changelog are updated and a new tag (`vX.Y.Z`) is created.
- If commits do not qualify (for example docs/chore only), release is a no-op and no publish is triggered.
- After a tag is created, GitHub Release notes are generated automatically.
- CI is then triggered on that tag to build artifacts and publish to PyPI.
- CI release pipeline is tag-driven (`vX.Y.Z`) to build artifacts and publish to PyPI.
- Workflow dispatch is kept only as internal fallback trigger from `Semantic Release` automation.

## Simple Trigger Guide

Expand All @@ -108,10 +109,11 @@ Use this rule of thumb for automatic versioning:
How to trigger semantic release until publish to PyPI:

1. Push commits to default branch (direct push or merged PR), using Conventional Commit messages.
2. Open GitHub Actions and run `Semantic Release` on default branch.
3. Workflow evaluates commits and creates tag `vX.Y.Z` when releasable commits exist.
4. Workflow creates the corresponding GitHub Release.
5. CI workflow runs on that tag and publishes artifacts to PyPI.
2. Open GitHub Actions and run `Semantic Release` on the default branch.
3. Choose `release_type`: `auto` (default) for commit-based bump, or `patch`/`minor`/`major` to force bump manually.
4. Workflow evaluates commits and creates tag `vX.Y.Z` when releasable commits exist.
5. Workflow creates the corresponding GitHub Release.
6. CI workflow runs on that tag and publishes artifacts to PyPI.

Manual fallback (if needed):

Expand Down
Loading
Loading