Skip to content

Commit 31a8ca9

Browse files
authored
Merge pull request #474 from plotly/add-release-instructions
Add release instructions to repo
2 parents 90be50a + 75dc279 commit 31a8ca9

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

‎RELEASE.md‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Releasing Kaleido
2+
3+
Follow the steps in this document to release a new version of Kaleido.
4+
5+
## Overview
6+
7+
- Versions are determined automatically from git tags by `setuptools-git-versioning`. There is no hard-coded version string to update. Pushing a `v*` tag triggers CI, which tests and publishes the package to TestPyPI.
8+
- Publishing to PyPI and creating a GitHub release are done manually.
9+
10+
## Release steps
11+
12+
1. Create release branch titled `release-vX.Y.Z`
13+
- We try to follow [semantic versioning guidelines](https://semver.org) as much as possible
14+
2. Update the changelog:
15+
- Review the items in `CHANGELOG.md` under the "Unreleased" header
16+
- Ensure all items follow this format:
17+
- `- Description of change [[#XXXX](https://github.com/plotly/Kaleido/pull/XXXX)]`
18+
- ...followed by `with thanks to @username for the contribution!` if the PR is from a community contributor
19+
- Add any missing items (PRs which were merged since the last release)
20+
- PRs which don't change the contents of the built package (e.g. changes to the README, etc.) and minor dependency upgrades don't need to be mentioned
21+
- Add a header `## vX.Y.Z` above the unreleased items, under `## Unreleased`
22+
- Commit and push the `CHANGELOG.md` updates
23+
- _Normally, the changelog is the only file that needs to be updated when making a release. The package version is determined automatically as explained in the overview above._
24+
3. Open a PR into `main`, wait for tests to pass, get approval, and then merge into `main`.
25+
4. On your local machine, check out `main`, pull, and tag the release branch merge commit with the version number:
26+
```
27+
git checkout main
28+
git pull
29+
git tag vX.Y.Z
30+
git push origin vX.Y.Z
31+
```
32+
5. Build the release artifacts:
33+
34+
- [Install `uv`](https://docs.astral.sh/uv/getting-started/installation/) if not already installed on your machine
35+
36+
- Ensure your git environment inside the `Kaleido/` directory is totally clean, i.e. `git status` returns the following:
37+
38+
```
39+
On branch main
40+
Your branch is up to date with 'origin/main'.
41+
42+
nothing to commit, working tree clean
43+
```
44+
45+
- If needed, stash or delete/move files to get to a clean environment. This is important because `setuptools-git-versioning` will not generate the correct version number if you have untracked or changed files present.
46+
47+
- Build the package:
48+
```
49+
cd src/py/
50+
uv build
51+
```
52+
- Two artifacts will be added to `src/py/dist`. Ensure that they have the correct filenames:
53+
- `kaleido-X.Y.Z-py3-none-any.whl`
54+
- `kaleido-X.Y.Z.tar.gz`
55+
6. Release on GitHub:
56+
- Go to https://github.com/plotly/Kaleido/releases and click "Draft a new release"
57+
- Select the `vX.Y.Z` tag you created previously
58+
- Copy and paste the relevant changelog section into the release notes
59+
- Upload the `.whl` and `.tar.gz` build artifacts
60+
7. Release on PyPI:
61+
- Install the `twine` Python package if not already installed (`pip install twine`)
62+
- `cd` into the `dist/` directory
63+
- Use `twine` to upload the artifacts to PyPI:
64+
```
65+
twine upload kaleido-X.Y.Z*
66+
```
67+
- You will need to enter an API token proving you have permission to publish
68+
69+
That's it! Make sure to visit https://pypi.org/project/kaleido to verify that the new package version is available.

0 commit comments

Comments
 (0)