File tree Expand file tree Collapse file tree 4 files changed +603
-0
lines changed
Expand file tree Collapse file tree 4 files changed +603
-0
lines changed Original file line number Diff line number Diff line change 1+ name : PR Quality Gate
2+
3+ on :
4+ pull_request :
5+ branches : [master]
6+
7+ jobs :
8+ validate :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+
13+ - name : Install uv
14+ uses : astral-sh/setup-uv@v5
15+
16+ - name : Set up Python
17+ run : uv python install 3.12
18+
19+ - name : Install dependencies
20+ run : uv sync --all-extras --dev
21+
22+ - name : Lint and Format Check
23+ run : uv run poe check
24+
25+ - name : Run Tests with Coverage
26+ run : uv run poe test
Original file line number Diff line number Diff line change 1+ name : Auto Release & Publish
2+
3+ on :
4+ push :
5+ branches : [master]
6+
7+ jobs :
8+ release :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ id-token : write # MANDATORY for PyPI Trusted Publishing
12+ contents : write # MANDATORY for Semantic Release to push tags/commits
13+
14+ steps :
15+ - uses : actions/checkout@v4
16+ with :
17+ fetch-depth : 0 # Required to read the git commit history
18+
19+ - name : Install uv
20+ uses : astral-sh/setup-uv@v5
21+
22+ - name : Set up Python
23+ run : uv python install 3.12
24+
25+ - name : Python Semantic Release
26+ id : semantic
27+ uses : python-semantic-release/python-semantic-release@v9
28+ with :
29+ github_token : ${{ secrets.GITHUB_TOKEN }}
30+
31+ # The step above automatically runs `uv build` (because we set it in pyproject.toml)
32+ # BUT it only does this IF there are commits that trigger a release (feat:, fix:, etc.)
33+
34+ - name : Publish to PyPI
35+ if : steps.semantic.outputs.released == 'true'
36+ run : uv publish
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ dev = [
2929 " pre-commit>=4.5.1" ,
3030 " pytest>=9.0.2" ,
3131 " pytest-cov>=7.0.0" ,
32+ " python-semantic-release>=10.5.3" ,
3233 " ruff>=0.15.2" ,
3334]
3435
@@ -42,3 +43,9 @@ clean = """
4243rm -rf .venv .ruff_cache .pytest_cache .coverage htmlcov dist build *.egg-info
4344"""
4445lint = [" fix" , " format" ]
46+
47+ [tool .semantic_release ]
48+ version_toml = [" pyproject.toml:project.version" ]
49+ branch = " master"
50+ build_command = " uv build"
51+ commit_message = " chore(release): {version} [skip ci]"
You can’t perform that action at this time.
0 commit comments