2021-01-22 06:14:54 +08:00
# Releasing JupyterLab Classic
2021-01-05 19:09:41 +08:00
2021-01-22 06:14:54 +08:00
## Automated releases
Releases are automated using GitHub Actions. They are triggered when a new tag is pushed to the remote.
To cut a new release, run the following:
```bash
# checkout the main branch
git checkout main
# for a patch release
jlpm release:patch
# for a minor version bump
jlpm release:bump minor
# for a major version bump
jlpm release:bump major
2021-01-05 19:09:41 +08:00
2021-01-22 06:14:54 +08:00
# push to the main branch
git push origin main --tags
```
We follow a similar bump strategy as in JupyterLab: https://github.com/jupyterlab/jupyterlab/blob/master/RELEASE.md#bump-version
The release workflow also creates a GitHub release with the new changes generated with [github-changelog-generator ](https://github.com/github-changelog-generator/github-changelog-generator ).
If you would still like to do the release manually instead, read below.
## Making a nanual new release of JupyterLab Classic
This process is still a bit manual and consists in running a couple of commands.
2021-01-05 19:09:41 +08:00
## Getting a clean environment
Creating a new environment can help avoid pushing local changes and any extra tag.
```bash
2021-01-13 17:44:04 +08:00
mamba create -q -y -n jupyterlab-classic-release -c conda-forge twine nodejs jupyter-packaging jupyterlab -y
2021-01-05 19:09:41 +08:00
conda activate jupyterlab-classic-release
```
Alternatively, the local repository can be cleaned with:
```bash
git clean -fdx
```
## Releasing on PyPI
Make sure the `dist/` folder is empty.
1. Update [jupyterlab_classic/\_version.py ](./jupyterlab_classic/_version.py ) with the new version number
2021-01-13 17:44:04 +08:00
2. Commit the changes
2021-01-13 18:02:04 +08:00
- `git add jupyterlab_classic/_version.py`
- `git commit -m "Release x.y.z"`
2021-01-13 17:44:04 +08:00
3. Bump the frontend packages:
2021-01-13 18:02:04 +08:00
- `jlpm`
- `jlpm run lerna version x.y.z --no-push --amend --force-publish`
2021-01-13 17:44:04 +08:00
4. Run: `python setup.py sdist bdist_wheel`
5. Double check the size of the bundles in the `dist/` folder
6. Test the release by installing the wheel or sdist: `python -m pip install ./dist/jupyterlab_classic-x.y.z-py3-none-any.whl
7. `export TWINE_USERNAME=mypypi_username`
8. `twine upload dist/*`
2021-01-05 19:09:41 +08:00
2021-01-07 17:44:08 +08:00
## Releasing on conda-forge
The simplest is to wait for the bot to automatically open the PR.
Alternatively, to do the update manually:
1. Open a new PR on https://github.com/conda-forge/jupyterlab-classic-feedstock to update the `version` and the `sha256` hash
2. Wait for the tests
3. Merge the PR
The new version will be available on `conda-forge` soon after.
2021-01-05 19:09:41 +08:00
## Publish the packages to npm
2021-01-13 17:44:04 +08:00
1. Publish the packages: `jlpm run lerna publish from-package`
2021-01-05 19:09:41 +08:00
## Committing and tagging
Push the release commit to the `main` branch:
```bash
git push origin main
```
Then create a new release from the GitHub interface.