Skip to content

Commit c3aaed3

Browse files
sionsmithclaude
andcommitted
ci: add release-please workflow matching keito-node pattern
Split publish out of ci.yml into release.yml using release-please-action. Release PRs are auto-created from conventional commits; merging triggers lint, test, build, and PyPI publish. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ac14a20 commit c3aaed3

2 files changed

Lines changed: 55 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
name: ci
2-
on: [push, pull_request]
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
39
jobs:
410
lint:
511
runs-on: ubuntu-latest
@@ -25,21 +31,3 @@ jobs:
2531
- run: pip install -e ".[dev]"
2632
- name: Test
2733
run: pytest --cov=keito --cov-report=xml
28-
29-
publish:
30-
needs: [lint, test]
31-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
32-
runs-on: ubuntu-latest
33-
steps:
34-
- uses: actions/checkout@v4
35-
- uses: actions/setup-python@v5
36-
with:
37-
python-version: "3.12"
38-
- run: pip install build twine
39-
- name: Build
40-
run: python -m build
41-
- name: Publish to PyPI
42-
run: twine upload dist/*
43-
env:
44-
TWINE_USERNAME: __token__
45-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
release_created: ${{ steps.release.outputs.release_created }}
16+
tag_name: ${{ steps.release.outputs.tag_name }}
17+
steps:
18+
- uses: googleapis/release-please-action@v4
19+
id: release
20+
with:
21+
release-type: python
22+
23+
publish:
24+
needs: release-please
25+
if: ${{ needs.release-please.outputs.release_created }}
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
id-token: write
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.12"
35+
- run: pip install -e ".[dev]"
36+
- name: Lint
37+
run: ruff check .
38+
- name: Test
39+
run: pytest
40+
- run: pip install build twine
41+
- name: Build
42+
run: python -m build
43+
- name: Publish to PyPI
44+
run: twine upload dist/*
45+
env:
46+
TWINE_USERNAME: __token__
47+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)