Skip to content

Commit 0b7a4c4

Browse files
Copilotobserverw
andauthored
Add automatic release note generation on tag push (#16)
* Initial plan * Add automatic release note generation workflow Co-authored-by: observerw <[email protected]> * Add release process documentation Co-authored-by: observerw <[email protected]> * Remove unnecessary fetch-depth parameter from release workflow Co-authored-by: observerw <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: observerw <[email protected]>
1 parent a66b625 commit 0b7a4c4

File tree

3 files changed

+123
-0
lines changed

3 files changed

+123
-0
lines changed

.github/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
- dependencies
6+
authors:
7+
- dependabot
8+
categories:
9+
- title: 🚀 Features
10+
labels:
11+
- feature
12+
- enhancement
13+
- title: 🐛 Bug Fixes
14+
labels:
15+
- bug
16+
- fix
17+
- title: 📚 Documentation
18+
labels:
19+
- documentation
20+
- docs
21+
- title: 🧹 Maintenance
22+
labels:
23+
- chore
24+
- maintenance
25+
- refactor
26+
- title: 🔧 Other Changes
27+
labels:
28+
- "*"

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
create-release:
13+
name: Create GitHub Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Create Release
19+
uses: actions/github-script@v7
20+
with:
21+
script: |
22+
const { data: release } = await github.rest.repos.createRelease({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
tag_name: context.ref.replace('refs/tags/', ''),
26+
name: context.ref.replace('refs/tags/', ''),
27+
generate_release_notes: true,
28+
draft: false,
29+
prerelease: false
30+
});
31+
console.log(`Created release ${release.html_url}`);

docs/RELEASE.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Release Process
2+
3+
This repository uses automated release management with GitHub Actions.
4+
5+
## Creating a Release
6+
7+
To create a new release:
8+
9+
1. **Update the version** in `pyproject.toml`:
10+
```toml
11+
version = "0.2.0"
12+
```
13+
14+
2. **Commit and push** your changes:
15+
```bash
16+
git add pyproject.toml
17+
git commit -m "chore: bump version to 0.2.0"
18+
git push
19+
```
20+
21+
3. **Create and push a version tag**:
22+
```bash
23+
git tag v0.2.0
24+
git push origin v0.2.0
25+
```
26+
27+
4. **Automatic actions**:
28+
- The `release.yml` workflow will automatically create a GitHub release with auto-generated release notes
29+
- The `publish.yml` workflow will trigger and publish the package to PyPI
30+
31+
## Release Notes
32+
33+
Release notes are automatically generated based on:
34+
- Pull request titles and descriptions since the last release
35+
- Labels applied to pull requests (see `.github/release.yml` for categories)
36+
37+
### PR Labels for Release Notes
38+
39+
Label your pull requests to categorize them in release notes:
40+
41+
- `feature`, `enhancement` → 🚀 Features
42+
- `bug`, `fix` → 🐛 Bug Fixes
43+
- `documentation`, `docs` → 📚 Documentation
44+
- `chore`, `maintenance`, `refactor` → 🧹 Maintenance
45+
- Unlabeled PRs → 🔧 Other Changes
46+
47+
### Excluding from Release Notes
48+
49+
To exclude a PR from release notes, add one of these labels:
50+
- `ignore-for-release`
51+
- `dependencies`
52+
53+
## Manual Release (Alternative)
54+
55+
If you prefer to create releases manually:
56+
57+
1. Go to the [Releases page](https://github.com/lsp-client/python-sdk/releases)
58+
2. Click "Draft a new release"
59+
3. Choose or create a tag (e.g., `v0.2.0`)
60+
4. Click "Generate release notes" to auto-generate notes
61+
5. Review and edit as needed
62+
6. Click "Publish release"
63+
64+
The `publish.yml` workflow will still trigger automatically to publish to PyPI.

0 commit comments

Comments
 (0)