Skip to content

Commit 5ec0ad6

Browse files
authored
Update Release Scripts (#237)
* Update Release Scripts * bump to v2 * update checks * cleanup
1 parent b2fa16c commit 5ec0ad6

File tree

6 files changed

+165
-30
lines changed

6 files changed

+165
-30
lines changed

.github/workflows/check-release.yml

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

.github/workflows/prep-release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
silent:
16+
description: "Set a placeholder in the changelog and don't publish the release."
17+
required: false
18+
type: boolean
19+
since:
20+
description: "Use PRs with activity since this date or git reference"
21+
required: false
22+
since_last_stable:
23+
description: "Use PRs with activity since the last stable git tag"
24+
required: false
25+
type: boolean
26+
jobs:
27+
prep_release:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
31+
steps:
32+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
33+
34+
- name: Prep Release
35+
id: prep-release
36+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
version_spec: ${{ github.event.inputs.version_spec }}
40+
silent: ${{ github.event.inputs.silent }}
41+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
42+
target: ${{ github.event.inputs.target }}
43+
branch: ${{ github.event.inputs.branch }}
44+
since: ${{ github.event.inputs.since }}
45+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
46+
47+
- name: "** Next Step **"
48+
run: |
49+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Publish Changelog"
2+
on:
3+
release:
4+
types: [published]
5+
6+
workflow_dispatch:
7+
inputs:
8+
branch:
9+
description: "The branch to target"
10+
required: false
11+
12+
jobs:
13+
publish_changelog:
14+
runs-on: ubuntu-latest
15+
environment: release
16+
steps:
17+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
18+
19+
- uses: actions/create-github-app-token@v1
20+
id: app-token
21+
with:
22+
app-id: ${{ vars.APP_ID }}
23+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
24+
25+
- name: Publish changelog
26+
id: publish-changelog
27+
uses: jupyter-server/jupyter_releaser/.github/actions/publish-changelog@v2
28+
with:
29+
token: ${{ steps.app-token.outputs.token }}
30+
branch: ${{ github.event.inputs.branch }}
31+
32+
- name: "** Next Step **"
33+
run: |
34+
echo "Merge the changelog update PR: ${{ steps.publish-changelog.outputs.pr_url }}"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
permissions:
20+
id-token: write
21+
steps:
22+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
23+
24+
- uses: actions/create-github-app-token@v1
25+
id: app-token
26+
with:
27+
app-id: ${{ vars.APP_ID }}
28+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
29+
30+
- name: Populate Release
31+
id: populate-release
32+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
33+
with:
34+
token: ${{ steps.app-token.outputs.token }}
35+
branch: ${{ github.event.inputs.branch }}
36+
release_url: ${{ github.event.inputs.release_url }}
37+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
38+
39+
- name: Finalize Release
40+
id: finalize-release
41+
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
42+
with:
43+
token: ${{ steps.app-token.outputs.token }}
44+
release_url: ${{ steps.populate-release.outputs.release_url }}
45+
46+
- name: "** Next Step **"
47+
if: ${{ success() }}
48+
run: |
49+
echo "Verify the final release"
50+
echo ${{ steps.finalize-release.outputs.release_url }}
51+
52+
- name: "** Failure Message **"
53+
if: ${{ failure() }}
54+
run: |
55+
echo "Failed to Publish the Draft Release Url:"
56+
echo ${{ steps.populate-release.outputs.release_url }}

.github/workflows/test.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: tests
33

44
on:
55
push:
6-
pull_request:
76
branches: [ "main" ]
7+
pull_request:
88
schedule:
99
# Run weekly
1010
# * is a special character in YAML so you have to quote this string
@@ -58,3 +58,25 @@ jobs:
5858
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1
5959
with:
6060
test_command: "jupyter kernelspec list | grep octave"
61+
62+
check_release:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
- name: Base Setup
68+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
69+
- name: Install Dependencies
70+
run: |
71+
pip install -e .
72+
- name: Check Release
73+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
74+
with:
75+
token: ${{ secrets.GITHUB_TOKEN }}
76+
77+
link_check:
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@v4
81+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
82+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,6 @@ tag_template = "v{new_version}"
6969

7070
[[tool.tbump.file]]
7171
src = "octave_kernel/_version.py"
72+
73+
[tool.check-wheel-contents]
74+
ignore = ["W002"]

0 commit comments

Comments
 (0)