Skip to content

Commit eb130ad

Browse files
committed
ci: replace tag-triggered release with release-please
Switch from manual v* tag workflow to googleapis/release-please-action. Conventional commits on main now auto-maintain a Release PR with changelog and version bump. Merging that PR triggers uv build + PyPI publish.
1 parent 165a15e commit eb130ad

File tree

3 files changed

+54
-10
lines changed

3 files changed

+54
-10
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1-
name: Release to PyPI
1+
name: Release
22

33
on:
44
push:
5-
tags: ["v*"]
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
610

711
jobs:
8-
release:
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+
config-file: release-please-config.json
22+
manifest-file: .release-please-manifest.json
23+
24+
publish:
25+
needs: release-please
26+
if: ${{ needs.release-please.outputs.release_created }}
927
runs-on: ubuntu-latest
10-
permissions:
11-
contents: write
1228
steps:
1329
- uses: actions/checkout@v4
1430

@@ -17,8 +33,3 @@ jobs:
1733
- run: uv build
1834

1935
- run: uv publish --token ${{ secrets.PYPI_TOKEN }}
20-
21-
- name: Create GitHub Release
22-
env:
23-
GH_TOKEN: ${{ github.token }}
24-
run: gh release create "${{ github.ref_name }}" dist/* --generate-notes

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.2.0"
3+
}

release-please-config.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "python",
4+
"include-v-in-tag": true,
5+
"bump-minor-pre-major": true,
6+
"bump-patch-for-minor-pre-major": true,
7+
"packages": {
8+
".": {
9+
"package-name": "opencode-usage",
10+
"extra-files": [
11+
{
12+
"type": "toml",
13+
"path": "pyproject.toml",
14+
"jsonpath": "$.project.version"
15+
}
16+
],
17+
"changelog-sections": [
18+
{ "type": "feat", "section": "Features" },
19+
{ "type": "fix", "section": "Bug Fixes" },
20+
{ "type": "refactor", "section": "Code Refactoring" },
21+
{ "type": "perf", "section": "Performance Improvements" },
22+
{ "type": "docs", "section": "Documentation" },
23+
{ "type": "test", "section": "Tests", "hidden": true },
24+
{ "type": "chore", "section": "Miscellaneous", "hidden": true },
25+
{ "type": "ci", "section": "CI", "hidden": true },
26+
{ "type": "style", "section": "Styles", "hidden": true }
27+
]
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)