Skip to content

Commit 9126fec

Browse files
committed
feat: trigger publish on tag push and auto-create GitHub Release
- Change publish workflow trigger from release:published to push:tags:v* - Add release job that auto-creates a GitHub Release with generated notes - Update RELEASE.md to reflect the streamlined flow
1 parent ad913f4 commit 9126fec

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: Publish to PyPI
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
tags:
6+
- "v*"
67

78
permissions:
8-
contents: read
9+
contents: write
910
id-token: write
1011

1112
jobs:
@@ -50,3 +51,14 @@ jobs:
5051

5152
- name: Publish to PyPI
5253
uses: pypa/gh-action-pypi-publish@release/v1
54+
55+
release:
56+
needs: publish
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v6
60+
61+
- name: Create GitHub Release
62+
run: gh release create "${{ github.ref_name }}" --generate-notes
63+
env:
64+
GH_TOKEN: ${{ github.token }}

RELEASE.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,20 @@ git push && git push --tags
5757

5858
### Automated (Recommended)
5959

60-
Publishing is handled by GitHub Actions. The workflow (`.github/workflows/publish.yml`) triggers when a **GitHub Release** is published:
60+
Publishing is handled by GitHub Actions (`.github/workflows/publish.yml`). Pushing a version tag triggers the full pipeline automatically:
6161

62-
1. Push the version bump and tag (see above)
63-
2. Go to [GitHub Releases](https://github.com/smorinlabs/worktreeflow/releases)
64-
3. Click **Draft a new release**
65-
4. Select the tag you just pushed (e.g., `v0.4.0`)
66-
5. Add release notes
67-
6. Click **Publish release**
62+
```bash
63+
make release # bump, commit, tag
64+
git push && git push --tags # triggers CI
65+
```
6866

6967
The CI will automatically:
70-
- Run the test suite
71-
- Build the package with `uv build`
72-
- Publish to PyPI via OIDC (trusted publisher)
68+
1. Run the test suite
69+
2. Build the package with `uv build`
70+
3. Publish to PyPI via OIDC (trusted publisher)
71+
4. Create a GitHub Release with auto-generated notes
72+
73+
No manual GitHub Release creation needed — it's all triggered by the tag push.
7374

7475
### Manual
7576

@@ -90,4 +91,3 @@ uv publish # requires PyPI API token
9091
- [ ] `wtf version` shows correct version
9192
- [ ] Changes committed and tagged (`make release`)
9293
- [ ] Pushed to remote (`git push && git push --tags`)
93-
- [ ] GitHub Release created

0 commit comments

Comments
 (0)