|
| 1 | +# Making a new release of JupyterLab-DrawIO |
| 2 | + |
| 3 | +## Getting a clean environment |
| 4 | + |
| 5 | +Creating a new environment can help avoid pushing local changes and any extra tag. |
| 6 | + |
| 7 | +```bash |
| 8 | +mamba create -q -y -n drawio-release -c conda-forge twine nodejs keyring pip matplotlib jupyter-packaging jupyterlab |
| 9 | +conda activate drawio-release |
| 10 | +``` |
| 11 | + |
| 12 | +Alternatively, the local repository can be cleaned with: |
| 13 | + |
| 14 | +```bash |
| 15 | +git clean -fdx |
| 16 | +``` |
| 17 | + |
| 18 | +## Releasing on PyPI |
| 19 | + |
| 20 | +Make sure the `dist/` folder is empty. |
| 21 | + |
| 22 | +1. Update [package.json](./package.json) and [binder/environment.yml](./binder/environment.yml) with the new version number |
| 23 | +2. `python setup.py sdist bdist_wheel` |
| 24 | +3. Double check the size of the bundles in the `dist/` folder |
| 25 | +4. Run the tests |
| 26 | +5. Make sure the JupyterLab extension is correctly bundled in source distribution |
| 27 | +6. `export TWINE_USERNAME=mypypi_username` |
| 28 | +7. `twine upload dist/*` |
| 29 | + |
| 30 | +# Making a new release of jupyterlab-drawio |
| 31 | + |
| 32 | +The prebuilt extension is already packaged in the main Python package. |
| 33 | + |
| 34 | +However we also publish it to `npm` to: |
| 35 | + |
| 36 | +- let other third-party extensions depend on `jupyterlab-drawio` |
| 37 | +- let users install from source if they would like to |
| 38 | +- bundle the extension into the JupyterLab app |
| 39 | + |
| 40 | +## Releasing on npm |
| 41 | + |
| 42 | +1. The version number in [package.json](./package.json) should have been updated during the release step of the Python package (see above) |
| 43 | +2. `npm login` |
| 44 | +3. `npm publish` |
| 45 | + |
| 46 | +## Releasing on conda-forge |
| 47 | + |
| 48 | +> The next steps aren't valid for now. We don't have a recipe for jupyterlab-drawio yet. |
| 49 | +
|
| 50 | +The simplest is to wait for the bot to automatically open the PR. |
| 51 | + |
| 52 | +Alternatively, to do the update manually: |
| 53 | + |
| 54 | +1. Open a new PR on https://github.com/conda-forge/jupyterlab-drawio-feedstock to update the `version` and the `sha256` hash (see [example](https://github.com/conda-forge/jupyterlab-drawio-feedstock/pull/12/files)) |
| 55 | +2. Wait for the tests |
| 56 | +3. Merge the PR |
| 57 | + |
| 58 | +The new version will be available on `conda-forge` soon after. |
| 59 | + |
| 60 | +## Committing and tagging |
| 61 | + |
| 62 | +Commit the changes, create a new release tag, and update the `stable` branch (for Binder), where `x.y.z` denotes the new version: |
| 63 | + |
| 64 | +```bash |
| 65 | +git checkout master |
| 66 | +git add binder/environment.yml package.json |
| 67 | +git commit -m "Release x.y.z" |
| 68 | +git tag x.y.z |
| 69 | +git checkout stable |
| 70 | +git reset --hard master |
| 71 | +git push origin master stable x.y.z |
| 72 | +``` |
0 commit comments