Skip to content

Commit d082364

Browse files
committed
Add release instructions
1 parent 9ba6ef9 commit d082364

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,57 @@ python -m build
6666
```
6767

6868
The artifacts will be generated in the `dist/` directory.
69+
70+
Since this is a Python project using `setuptools_scm`, versioning is handled automatically based on git tags. I've adapted the workflow from your JS library to Python conventions while maintaining the same straightforward structure.
71+
72+
Add this section to the end of your `CONTRIBUTING.md`:
73+
74+
---
75+
76+
## Releases
77+
78+
Releases are automated via GitHub Actions and triggered by pushing git tags. The project uses `setuptools_scm`, so the version is derived directly from the tag name.
79+
80+
### Prerelease (Beta)
81+
82+
Use this to test new features without affecting stable users on PyPI.
83+
84+
1. Ensure your changes are merged into `main`.
85+
2. Switch to `main` locally and pull the latest:
86+
```bash
87+
git switch main
88+
git pull origin main
89+
```
90+
3. Create and push a beta tag (e.g., `v1.2.0-beta.1`):
91+
```bash
92+
git tag -a v1.2.0-beta.1 -m "v1.2.0-beta.1"
93+
git push origin v1.2.0-beta.1
94+
```
95+
96+
The CI will automatically publish to PyPI and create a GitHub prerelease.
97+
98+
### Production Release
99+
100+
1. Ensure the `main` branch is ready for production.
101+
2. Switch to `main` locally and pull the latest:
102+
```bash
103+
git switch main
104+
git pull origin main
105+
```
106+
3. Create and push a production tag (must start with `v`):
107+
```bash
108+
git tag -a v1.2.0 -m "v1.2.0"
109+
git push origin v1.2.0
110+
```
111+
112+
The CI will build the distribution archives, publish to PyPI, and create a stable GitHub Release with generated release notes.
113+
114+
### Syncing back to Dev
115+
116+
After any release, ensure the tags are available in your development branch to keep `setuptools_scm` versions in sync:
117+
118+
```bash
119+
git switch dev
120+
git merge main
121+
git push origin dev
122+
```

0 commit comments

Comments
 (0)