Skip to content

Commit 8d70d27

Browse files
Improve documentation (#569)
* Improve convert_repo_from_repo.md * Update making_release_from_repo.md * lint --------- Co-authored-by: Steven Silvester <[email protected]> Co-authored-by: Steven Silvester <[email protected]>
1 parent df988e4 commit 8d70d27

File tree

2 files changed

+54
-38
lines changed

2 files changed

+54
-38
lines changed

docs/source/get_started/making_release_from_repo.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ already uses Jupyter Releaser using workflows on its own repository.
2020

2121
![Prep Release Workflow Dialog](../images/prep_release_repo.png)
2222

23-
- The "New Version Spec" will usually be the full version (e.g. 0.7.1). Repos using `tbump` can also use:
24-
25-
- "next" or "patch" option, which will bump the micro version (or the build version in the case of a prerelease).
26-
Note: The "next" and "patch" options are not available when using dev versions, you must use explicit versions
27-
instead.
28-
- "minor" option, which will bump to the next minor version directly.
29-
- "release" option, which will start making prereleases (a0, a1...)
23+
- The "New Version Spec" will usually be the full version (e.g. 0.7.1).
24+
Repos using `hatch` can also use [segments](https://hatch.pypa.io/latest/version/#supported-segments) such as _patch_, _minor_, _alpha_,... .
3025

3126
- Use the "since" field to select PRs prior to the latest tag to include in the release
3227

docs/source/how_to_guides/convert_repo_from_repo.md

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ See checklist below for details:
99
- Markdown changelog
1010
- Bump version configuration (if using Python), for example [hatch](https://hatch.pypa.io/latest/)
1111
- [Access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with access to target GitHub repo to run GitHub Actions.
12-
- Set up:
13-
- \[_modern way_\] [Add a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) to your PyPI project
14-
- \[_legacy way_\] Access token for the [PyPI registry](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github)
12+
- [Add a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) to your PyPI project
1513
- If needed, access token for [npm](https://docs.npmjs.com/creating-and-viewing-access-tokens).
1614

1715
## Checklist for Adoption
@@ -40,37 +38,43 @@ See checklist below for details:
4038
- Add a tags Ruleset for all tags
4139
- Allow the GitHub App to bypass protections
4240

43-
- [ ] Set up PyPI:
44-
45-
<details><summary>Using PyPI trusted publisher (modern way)</summary>
46-
47-
- Set up your PyPI project by [adding a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
48-
- if you use the example workflows, the _workflow name_ is `publish-release.yml` (or `full-release.yml`) and the
49-
_environment_ should be left blank.
50-
- Ensure the publish release job as `permissions`: `id-token : write` (see the [documentation](https://docs.pypi.org/trusted-publishers/using-a-publisher/))
41+
- [ ] Copy `prep-release.yml` and `publish-release.yml` (or only `full-release.yml`) from the
42+
[example-workflows](https://github.com/jupyter-server/jupyter_releaser/tree/main/example-workflows) folder in this repository.
5143

52-
</details>
53-
54-
<details><summary>Using PyPI token (legacy way)</summary>
55-
56-
- Add access token for the [PyPI registry](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github) stored as `PYPI_TOKEN`.
57-
_Note_ For security reasons, it is recommended that you scope the access
58-
to a single repository. Additionally, this token should belong to a
59-
machine account and not a user account.
44+
- [ ] Set up PyPI:
6045

61-
</details>
46+
- Set up your PyPI project by [adding a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
47+
- if you use the example workflows, the _workflow name_ is `publish-release.yml` (or `full-release.yml`) and the
48+
_environment_ should be `release` (the name of the GitHub environment).
49+
- Ensure the publish release job as `permissions`: `id-token : write` (see the [documentation](https://docs.pypi.org/trusted-publishers/using-a-publisher/))
6250

6351
- [ ] If needed, add access token for [npm](https://docs.npmjs.com/creating-and-viewing-access-tokens), saved as `NPM_TOKEN`. Again this should
6452
be created using a machine account that only has publish access.
53+
6554
- [ ] Ensure that only trusted users with 2FA have admin access to the repository, since they will be able to trigger releases.
55+
6656
- [ ] Switch to Markdown Changelog
57+
6758
- We recommend [MyST](https://myst-parser.readthedocs.io/en/latest/?badge=latest), especially if some of your docs are in reStructuredText.
6859
- Can use `pandoc -s changelog.rst -o changelog.md` and some hand edits as needed.
6960
- Note that [directives](https://myst-parser.readthedocs.io/en/latest/using/syntax.html#syntax-directives) can still be used
70-
- [ ] Add HTML start and end comment markers to Changelog file - see example in [CHANGELOG.md](https://github.com/jupyter-server/jupyter_releaser/blob/main/CHANGELOG.md) (view in raw mode)
61+
62+
- [ ] Add HTML start and end comment markers to Changelog file
63+
64+
- see example in [CHANGELOG.md](https://github.com/jupyter-server/jupyter_releaser/blob/main/CHANGELOG.md) (view in raw mode)
65+
66+
```md
67+
# Changelog
68+
69+
<!-- <START NEW CHANGELOG ENTRY> -->
70+
71+
<!-- <END NEW CHANGELOG ENTRY> -->
72+
```
73+
7174
- [ ] We recommend using [hatch](https://hatch.pypa.io/latest/) for your
7275
build system and for version handling.
73-
- If previously providing `version_info` like `version_info = (1, 7, 0, '.dev', '0')`, use a pattern like the one below in your version file:
76+
- If previously providing `version_info` like `version_info = (1, 7, 0, '.dev', '0')`,
77+
use a pattern like the one below in your version file:
7478

7579
```python
7680
import re
@@ -89,36 +93,53 @@ if match["rest"]:
8993
version_info = tuple(parts)
9094
```
9195

92-
- If you need to keep node and python versions in sync, use [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version). See [nbformat](https://github.com/jupyter/nbformat/blob/main/pyproject.toml) for example.
96+
- If you need to keep node and python versions in sync, use [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version).
97+
98+
- See [nbformat](https://github.com/jupyter/nbformat/blob/main/pyproject.toml) for example.
9399

94100
- [ ] Add a GitHub Actions CI step to run the `check_release` action. For example:
95101

102+
- This should be run on `push` and `pull` request events. You can copy
103+
the `check-release.yml` from this repo as an example.
104+
96105
```yaml
97106
- name: Check Release
98107
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
99108
with:
100109
token: ${{ secrets.GITHUB_TOKEN }}
101110
```
102111
103-
- This should be run on `push` and `pull` request events. You can copy
104-
the `check-release.yml` from this repo as an example.
105-
106112
- [ ] If you would like the release assets to be uploaded as artifacts, add the following step after the `check_release` action:
107113

108114
```yaml
109115
- name: Upload Distributions
110-
uses: actions/upload-artifact@v2
116+
uses: actions/upload-artifact@v4
111117
with:
112118
name: dist-${{ github.run_number }}
113119
path: .jupyter_releaser_checkout/dist
114120
```
115121

116-
- [ ] Add a workflow that uses the [`enforce-label`](https://github.com/jupyterlab/maintainer-tools#enforce-labels) action from `jupyterlab/maintainer-tools` to ensure that all PRs have on of the triage labels used to
117-
categorize the changelog.
122+
- [ ] Add a workflow that uses the [`enforce-label`](https://github.com/jupyterlab/maintainer-tools#enforce-labels) action
123+
from `jupyterlab/maintainer-tools` to ensure that all PRs have on of the triage labels used to categorize the changelog.
118124

119-
- [ ] Update or add `RELEASE.md` that describes the onboarding and release process, e.g. [jupyter_server](https://github.com/jupyter-server/jupyter_server/blob/main/RELEASE.md).
125+
```yaml
126+
name: Enforce PR label
127+
128+
on:
129+
pull_request:
130+
types: [labeled, unlabeled, opened, edited, synchronize]
131+
132+
jobs:
133+
enforce-label:
134+
runs-on: ubuntu-latest
135+
permissions:
136+
pull-requests: write
137+
steps:
138+
- name: enforce-triage-label
139+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1
140+
```
120141

121-
- [ ] Copy `prep-release.yml` and `publish-release.yml` from the `example-workflows` folder in this repository.
142+
- [ ] Update or add `RELEASE.md` that describes the onboarding and release process, e.g. [jupyter_server](https://github.com/jupyter-server/jupyter_server/blob/main/RELEASE.md).
122143

123144
- [ ] Optionally add configuration to the repository if non-standard options or hooks are needed.
124145

0 commit comments

Comments
 (0)