You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RELEASE.md
+62-12Lines changed: 62 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,31 @@ The extension can be published to `PyPI` and `npm` manually or using the [Jupyte
6
6
7
7
### Python package
8
8
9
-
This extension can be distributed as Python
10
-
packages. All of the Python
11
-
packaging instructions in the `pyproject.toml` file to wrap your extension in a
12
-
Python package. Before generating a package, we first need to install `build`.
9
+
This extension can be distributed as Python packages. All of the Python
10
+
packaging instructions are in the `pyproject.toml` file to wrap your extension in a
11
+
Python package. Before generating a package, you first need to install some tools:
13
12
14
13
```bash
15
-
pip install build twine
14
+
pip install build twine hatch
15
+
```
16
+
17
+
Bump the version using `hatch`. By default this will create a tag.
18
+
See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details.
19
+
20
+
```bash
21
+
hatch version <new-version>
22
+
```
23
+
24
+
Make sure to clean up all the development files before building the package:
25
+
26
+
```bash
27
+
jlpm clean:all
28
+
```
29
+
30
+
You could also clean up the local git repository:
31
+
32
+
```bash
33
+
git clean -dfX
16
34
```
17
35
18
36
To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
@@ -42,17 +60,49 @@ npm publish --access public
42
60
43
61
The extension repository should already be compatible with the Jupyter Releaser.
44
62
45
-
Check out the [workflow documentation](https://github.com/jupyter-server/jupyter_releaser#typical-workflow) for more information.
63
+
Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html) for more information.
46
64
47
65
Here is a summary of the steps to cut a new release:
48
66
49
-
- Fork the [`jupyter-releaser` repo](https://github.com/jupyter-server/jupyter_releaser)
50
-
- Add `ADMIN_GITHUB_TOKEN`, `PYPI_TOKEN` and `NPM_TOKEN` to the Github Secrets in the fork
67
+
- Add tokens to the [Github Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in the repository:
68
+
-`ADMIN_GITHUB_TOKEN` (with "public_repo" and "repo:status" permissions); see the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
69
+
-`NPM_TOKEN` (with "automation" permission); see the [documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens)
- Set up your PyPI project by [adding a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
75
+
- The _workflow name_ is `publish-release.yml` and the _environment_ should be left blank.
76
+
- Ensure the publish release job as `permissions`: `id-token : write` (see the [documentation](https://docs.pypi.org/trusted-publishers/using-a-publisher/))
- If the repo generates PyPI release(s), create a scoped PyPI [token](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github). We recommend using a scoped token for security reasons.
83
+
84
+
- You can store the token as `PYPI_TOKEN` in your fork's `Secrets`.
85
+
86
+
- Advanced usage: if you are releasing multiple repos, you can create a secret named `PYPI_TOKEN_MAP` instead of `PYPI_TOKEN` that is formatted as follows:
87
+
88
+
```text
89
+
owner1/repo1,token1
90
+
owner2/repo2,token2
91
+
```
92
+
93
+
If you have multiple Python packages in the same repository, you can point to them as follows:
0 commit comments