Skip to content

Commit a2dd7d5

Browse files
abrichrclaude
andcommitted
ci: switch to python-semantic-release for automated versioning
Replaces manual tag-triggered publish with python-semantic-release: - Automatic version bumping based on conventional commits - feat: -> minor, fix:/perf: -> patch - Creates GitHub releases automatically - Publishes to PyPI on release Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 27392d8 commit a2dd7d5

File tree

3 files changed

+59
-100
lines changed

3 files changed

+59
-100
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release and PyPI Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
concurrency: release
12+
permissions:
13+
id-token: write
14+
contents: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v4
29+
30+
- name: Python Semantic Release
31+
id: release
32+
uses: python-semantic-release/python-semantic-release@v9.15.2
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Build package
37+
if: steps.release.outputs.released == 'true'
38+
run: uv build
39+
40+
- name: Publish to PyPI
41+
if: steps.release.outputs.released == 'true'
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
44+
- name: Publish to GitHub Releases
45+
if: steps.release.outputs.released == 'true'
46+
uses: python-semantic-release/publish-action@v9.15.2
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,14 @@ packages = ["src/openadapt_grounding"]
8383

8484
[tool.ruff]
8585
line-length = 100
86+
87+
[tool.semantic_release]
88+
version_toml = ["pyproject.toml:project.version"]
89+
branch = "main"
90+
commit_message = "chore: release {version}"
91+
build_command = "uv build"
92+
93+
[tool.semantic_release.commit_parser_options]
94+
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "style", "test"]
95+
minor_tags = ["feat"]
96+
patch_tags = ["fix", "perf"]

0 commit comments

Comments
 (0)