Skip to content

Commit b78a2c8

Browse files
weklundclaude
andauthored
ci: add publish job to release-please and use GitHub-generated notes (#12)
## Summary - Moves CI and publish jobs into the release-please workflow, conditioned on `release_created == true` - Fixes the GITHUB_TOKEN limitation where releases created by `github-actions[bot]` don't trigger `publish.yml` - After Release Please creates a release, regenerates the notes using GitHub's native auto-generated format (`.github/release.yml` categories) instead of Release Please's commit-list style ## How it works 1. Release Please runs on every push to main — opens/updates a release PR 2. When the release PR is merged, Release Please creates the tag + release 3. Same workflow then: regenerates notes → runs CI → publishes to PyPI ## Test plan - [ ] Merge this PR — Release Please should open a release PR (for `ci:` commits, it won't — that's correct) - [ ] On next `fix:` or `feat:` merge, verify the full chain: release PR → merge → tag + release with GitHub-style notes → CI → PyPI publish 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ebfa5a1 commit b78a2c8

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,90 @@ permissions:
1111
jobs:
1212
release-please:
1313
runs-on: ubuntu-latest
14+
outputs:
15+
release_created: ${{ steps.release.outputs.release_created }}
16+
tag_name: ${{ steps.release.outputs.tag_name }}
1417
steps:
1518
- uses: googleapis/release-please-action@v4
19+
id: release
1620
with:
1721
token: ${{ secrets.GITHUB_TOKEN }}
1822
config-file: release-please-config.json
1923
manifest-file: .release-please-manifest.json
24+
25+
- name: Regenerate release notes
26+
if: ${{ steps.release.outputs.release_created == 'true' }}
27+
env:
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
gh api repos/${{ github.repository }}/releases/generate-notes \
31+
-f tag_name=${{ steps.release.outputs.tag_name }} \
32+
--jq '.body' \
33+
| gh release edit ${{ steps.release.outputs.tag_name }} \
34+
--repo ${{ github.repository }} \
35+
--notes-file -
36+
37+
ci:
38+
name: CI
39+
needs: release-please
40+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
41+
runs-on: macos-latest
42+
strategy:
43+
matrix:
44+
python-version: ["3.13"]
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v6
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v7
53+
with:
54+
enable-cache: true
55+
56+
- name: Install Python ${{ matrix.python-version }}
57+
run: uv python install ${{ matrix.python-version }}
58+
59+
- name: Install dependencies
60+
run: uv sync --dev
61+
62+
- name: Lint
63+
run: uv run ruff check src/ tests/
64+
65+
- name: Typecheck
66+
run: uv run python -m pyright
67+
68+
- name: Test
69+
run: uv run pytest --cov=src/mlx_stack -x -q --tb=short
70+
71+
publish:
72+
name: Build & Publish
73+
needs: [release-please, ci]
74+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
75+
runs-on: ubuntu-latest
76+
77+
permissions:
78+
id-token: write
79+
80+
environment:
81+
name: pypi
82+
url: https://pypi.org/p/mlx-stack
83+
84+
steps:
85+
- name: Checkout code
86+
uses: actions/checkout@v6
87+
with:
88+
ref: ${{ needs.release-please.outputs.tag_name }}
89+
fetch-depth: 0
90+
91+
- name: Install uv
92+
uses: astral-sh/setup-uv@v7
93+
with:
94+
enable-cache: true
95+
96+
- name: Build package
97+
run: uv build
98+
99+
- name: Publish to PyPI
100+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)