Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

Commit 88c2879

Browse files
authored
Add releaser workflows to the repo (#109)
* Add releaser workflows * Update RELEASE.md
1 parent 81192e6 commit 88c2879

File tree

3 files changed

+100
-57
lines changed

3 files changed

+100
-57
lines changed

.github/workflows/prep-release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Step 1: Prep Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
default: "next"
8+
required: false
9+
branch:
10+
description: "The branch to target"
11+
required: false
12+
post_version_spec:
13+
description: "Post Version Specifier"
14+
required: false
15+
since:
16+
description: "Use PRs with activity since this date or git reference"
17+
required: false
18+
since_last_stable:
19+
description: "Use PRs with activity since the last stable git tag"
20+
required: false
21+
type: boolean
22+
jobs:
23+
prep_release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
27+
28+
- name: Prep Release
29+
id: prep-release
30+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
31+
with:
32+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
33+
version_spec: ${{ github.event.inputs.version_spec }}
34+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
35+
target: ${{ github.event.inputs.target }}
36+
branch: ${{ github.event.inputs.branch }}
37+
since: ${{ github.event.inputs.since }}
38+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
39+
40+
- name: "** Next Step **"
41+
run: |
42+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"

.github/workflows/publish-release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Step 2: Publish Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: "The target branch"
7+
required: false
8+
release_url:
9+
description: "The URL of the draft GitHub release"
10+
required: false
11+
steps_to_skip:
12+
description: "Comma separated list of steps to skip"
13+
required: false
14+
15+
jobs:
16+
publish_release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
20+
21+
- name: Populate Release
22+
id: populate-release
23+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
24+
with:
25+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
26+
target: ${{ github.event.inputs.target }}
27+
branch: ${{ github.event.inputs.branch }}
28+
release_url: ${{ github.event.inputs.release_url }}
29+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
30+
31+
- name: Finalize Release
32+
id: finalize-release
33+
env:
34+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
35+
PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
36+
TWINE_USERNAME: __token__
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2
39+
with:
40+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
41+
target: ${{ github.event.inputs.target }}
42+
release_url: ${{ steps.populate-release.outputs.release_url }}
43+
44+
- name: "** Next Step **"
45+
if: ${{ success() }}
46+
run: |
47+
echo "Verify the final release"
48+
echo ${{ steps.finalize-release.outputs.release_url }}
49+
50+
- name: "** Failure Message **"
51+
if: ${{ failure() }}
52+
run: |
53+
echo "Failed to Publish the Draft Release Url:"
54+
echo ${{ steps.populate-release.outputs.release_url }}

RELEASE.md

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,8 @@
11
# Making a new release of jupyterlite_xeus_python
22

3-
The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).
3+
The recommended way to make a release is to use [`jupyter_releaser`](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html).
44

5-
## Manual release
5+
This repository contains the two workflows located under https://github.com/jupyterlite/xeus-python-kernel/actions:
66

7-
### Python package
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`.
13-
14-
```bash
15-
pip install build twine
16-
```
17-
18-
To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
19-
20-
```bash
21-
python -m build
22-
```
23-
24-
> `python setup.py sdist bdist_wheel` is deprecated and will not work for this package.
25-
26-
Then to upload the package to PyPI, do:
27-
28-
```bash
29-
twine upload dist/*
30-
```
31-
32-
### NPM package
33-
34-
To publish the frontend part of the extension as a NPM package, do:
35-
36-
```bash
37-
npm login
38-
npm publish --access public
39-
```
40-
41-
## Automated releases with the Jupyter Releaser
42-
43-
The extension repository should already be compatible with the Jupyter Releaser.
44-
45-
Check out the [workflow documentation](https://github.com/jupyter-server/jupyter_releaser#typical-workflow) for more information.
46-
47-
Here is a summary of the steps to cut a new release:
48-
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
51-
- Go to the Actions panel
52-
- Run the "Draft Changelog" workflow
53-
- Merge the Changelog PR
54-
- Run the "Draft Release" workflow
55-
- Run the "Publish Release" workflow
56-
57-
## Publishing to `conda-forge`
58-
59-
If the package is not on conda forge yet, check the documentation to learn how to add it: https://conda-forge.org/docs/maintainer/adding_pkgs.html
60-
61-
Otherwise a bot should pick up the new version publish to PyPI, and open a new PR on the feedstock repository automatically.
7+
- Step 1: Prep Release
8+
- Step 2: Publish Release

0 commit comments

Comments
 (0)