Skip to content

Commit 04dadb5

Browse files
authored
Update GitHub Actions and Prep for Release (#394)
* Update github workflows * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * update versions
1 parent 6567bcb commit 04dadb5

31 files changed

+362
-58
lines changed

.github/workflows/ci.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: kernel gateway tests
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
schedule:
8+
- cron: "0 0 * * *"
9+
10+
defaults:
11+
run:
12+
shell: bash -eux {0}
13+
14+
jobs:
15+
build:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, macos-latest]
21+
python-version: ["3.8", "3.11"]
22+
include:
23+
- os: macos-latest
24+
python-version: "3.9"
25+
- os: ubuntu-latest
26+
python-version: "3.12"
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Base Setup
32+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
33+
34+
- name: Run the tests
35+
timeout-minutes: 15
36+
run: |
37+
hatch run cov:test --cov-fail-under 50 || hatch run test:test --lf
38+
39+
- name: Show help
40+
run: |
41+
pip install .
42+
cd $HOME
43+
jupyter kernelgateway --help
44+
45+
- uses: jupyterlab/maintainer-tools/.github/actions/upload-coverage@v1
46+
47+
coverage:
48+
runs-on: ubuntu-latest
49+
needs:
50+
- build
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: jupyterlab/maintainer-tools/.github/actions/report-coverage@v1
54+
with:
55+
fail_under: 80
56+
57+
test_lint:
58+
name: Test Lint
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
63+
- name: Run Linters
64+
run: |
65+
#hatch run typing:test
66+
hatch run lint:build
67+
pipx run interrogate -vv .
68+
pipx run doc8 --max-line-length=200
69+
70+
check_release:
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
75+
- uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
76+
with:
77+
token: ${{ secrets.GITHUB_TOKEN }}
78+
79+
test_docs:
80+
runs-on: windows-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
84+
- run: hatch run docs:build
85+
86+
test_miniumum_versions:
87+
name: Test Minimum Versions
88+
timeout-minutes: 20
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v4
92+
- name: Base Setup
93+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
94+
with:
95+
dependency_type: minimum
96+
97+
- name: List installed packages
98+
run: |
99+
hatch run test:list
100+
101+
- name: Run the unit tests
102+
run: |
103+
hatch run test:nowarn || hatch run test:nowarn --lf
104+
105+
test_prereleases:
106+
name: Test Prereleases
107+
runs-on: ubuntu-latest
108+
timeout-minutes: 20
109+
steps:
110+
- name: Checkout
111+
uses: actions/checkout@v4
112+
- name: Base Setup
113+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
114+
with:
115+
dependency_type: pre
116+
- name: Run the tests
117+
run: |
118+
hatch run test:nowarn || hatch run test:nowarn --lf
119+
120+
make_sdist:
121+
name: Make SDist
122+
runs-on: ubuntu-latest
123+
timeout-minutes: 20
124+
steps:
125+
- uses: actions/checkout@v4
126+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
127+
- uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1
128+
129+
test_sdist:
130+
runs-on: ubuntu-latest
131+
needs: [make_sdist]
132+
name: Install from SDist and Test
133+
timeout-minutes: 20
134+
steps:
135+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
136+
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1
137+
138+
link_check:
139+
runs-on: ubuntu-latest
140+
steps:
141+
- uses: actions/checkout@v4
142+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
143+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
144+
145+
tests_check: # This job does nothing and is only used for the branch protection
146+
if: always()
147+
needs:
148+
- coverage
149+
- test_docs
150+
- test_miniumum_versions
151+
- test_lint
152+
- test_prereleases
153+
- check_release
154+
- link_check
155+
- test_sdist
156+
runs-on: ubuntu-latest
157+
steps:
158+
- name: Decide whether the needed jobs succeeded or failed
159+
uses: re-actors/alls-green@release/v1
160+
with:
161+
jobs: ${{ toJSON(needs) }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Enforce PR label
2+
3+
concurrency:
4+
group: label-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
types: [labeled, unlabeled, opened, edited, synchronize]
10+
jobs:
11+
enforce-label:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
15+
steps:
16+
- name: enforce-triage-label
17+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.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 }}"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
environment: release
19+
steps:
20+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
21+
22+
- name: Populate Release
23+
id: populate-release
24+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
25+
with:
26+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
27+
target: ${{ github.event.inputs.target }}
28+
branch: ${{ github.event.inputs.branch }}
29+
release_url: ${{ github.event.inputs.release_url }}
30+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
31+
32+
- name: Finalize Release
33+
id: finalize-release
34+
env:
35+
TWINE_USERNAME: __token__
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2
38+
with:
39+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
40+
target: ${{ github.event.inputs.target }}
41+
release_url: ${{ steps.populate-release.outputs.release_url }}
42+
43+
- name: "** Next Step **"
44+
if: ${{ success() }}
45+
run: |
46+
echo "Verify the final release"
47+
echo ${{ steps.finalize-release.outputs.release_url }}
48+
49+
- name: "** Failure Message **"
50+
if: ${{ failure() }}
51+
run: |
52+
echo "Failed to Publish the Draft Release Url:"
53+
echo ${{ steps.populate-release.outputs.release_url }}

.github/workflows/tests.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ repos:
6565
- id: ruff
6666
types_or: [python, jupyter]
6767
args: ["--fix", "--show-fixes"]
68-
exclude: ^kernel_gateway/tests/resources/
68+
exclude: ^tests/resources/
6969
- id: ruff-format
7070
types_or: [python, jupyter]
71-
exclude: ^kernel_gateway/tests/resources/
71+
exclude: ^tests/resources/
7272

7373
- repo: https://github.com/scientific-python/cookie
7474
rev: "2023.12.21"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
<!-- <START NEW CHANGELOG ENTRY> -->
4+
35
## 2.5.0 (2020-04-19)
46

57
([Full Changelog](https://github.com/jupyter/kernel_gateway/compare/2.4.3...50b26c553d7eaf6556b1ea9fd8f424388ebb2e94))
@@ -19,6 +21,8 @@
1921

2022
[@bgerrity](https://github.com/search?q=repo%3Ajupyter%2Fkernel_gateway+involves%3Abgerrity+updated%3A2020-08-18..2021-04-19&type=Issues) | [@dolfinus](https://github.com/search?q=repo%3Ajupyter%2Fkernel_gateway+involves%3Adolfinus+updated%3A2020-08-18..2021-04-19&type=Issues) | [@kevin-bates](https://github.com/search?q=repo%3Ajupyter%2Fkernel_gateway+involves%3Akevin-bates+updated%3A2020-08-18..2021-04-19&type=Issues) | [@mwouts](https://github.com/search?q=repo%3Ajupyter%2Fkernel_gateway+involves%3Amwouts+updated%3A2020-08-18..2021-04-19&type=Issues) | [@willingc](https://github.com/search?q=repo%3Ajupyter%2Fkernel_gateway+involves%3Awillingc+updated%3A2020-08-18..2021-04-19&type=Issues)
2123

24+
<!-- <END NEW CHANGELOG ENTRY> -->
25+
2226
## 2.4.3 (2020-08-18)
2327

2428
- [PR-340](https://github.com/jupyter/kernel_gateway/pull/340) enable ssl_version as a JKG config option

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

RELEASE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Release Guide
2+
3+
## Using `jupyter_releaser`
4+
5+
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).
6+
7+
## Manual Release
8+
9+
- Update `CHANGELOG`
10+
11+
- Run the following:
12+
13+
```bash
14+
export VERSION=<version>
15+
pip install pipx
16+
pipx run hatch version $VERSION
17+
git commit -a -m "Release $VERSION"
18+
git tag $VERSION; true;
19+
git push --all
20+
git push --tags
21+
rm -rf dist build
22+
pipx run build .
23+
pipx run twine check dist/*
24+
pipx run twine upload dist/*
25+
```

0 commit comments

Comments
 (0)