Skip to content

Commit f14c514

Browse files
committed
Setup releaser bot
1 parent 3baddd0 commit f14c514

File tree

4 files changed

+129
-0
lines changed

4 files changed

+129
-0
lines changed

.github/workflows/check-release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ['master']
5+
pull_request:
6+
branches: ['*']
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Check Release
16+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
version_spec: next
20+
21+
- name: Upload Distributions
22+
uses: actions/upload-artifact@v3
23+
with:
24+
name: jupytercad-releaser-dist-${{ github.run_number }}
25+
path: .jupyter_releaser_checkout/dist

.github/workflows/enforce-labels.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Enforce PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
jobs:
7+
enforce-label:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: enforce-triage-label
11+
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 }}"

.github/workflows/publish-release.yml

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

0 commit comments

Comments
 (0)