Skip to content

Commit 2cd3e74

Browse files
Refactor and Simplify Workflows (#363)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 519b8dd commit 2cd3e74

File tree

27 files changed

+660
-449
lines changed

27 files changed

+660
-449
lines changed

.github/actions/check-links/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ runs:
44
using: "composite"
55
steps:
66
- name: install-releaser
7-
uses: jupyter-server/jupyter_releaser/.github/actions/install-releaser@v1
7+
shell: bash -eux {0}
8+
id: install-releaser
9+
run: |
10+
# Install Jupyter Releaser from git unless we are testing Releaser itself
11+
if ! command -v jupyter-releaser &> /dev/null
12+
then
13+
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
14+
fi
815
916
- name: Cache checked links
1017
uses: actions/cache@v2

.github/actions/check-release/action.yml

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,48 @@ inputs:
44
token:
55
description: "GitHub access token"
66
required: true
7-
changelog:
8-
description: "Changelog file"
9-
default: "CHANGELOG.md"
10-
required: false
117
version_spec:
128
description: "New Version Specifier"
139
required: false
1410
default: ""
11+
steps_to_skip:
12+
description: "Comma separated list of steps to skip"
13+
required: false
1514
runs:
1615
using: "composite"
1716
steps:
18-
- name: install-releaser
19-
uses: jupyter-server/jupyter_releaser/.github/actions/install-releaser@v1
17+
- shell: bash -eux {0}
18+
id: install-releaser
19+
run: |
20+
# Install Jupyter Releaser from git unless we are testing Releaser itself
21+
if ! command -v jupyter-releaser &> /dev/null
22+
then
23+
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
24+
fi
2025
21-
- name: draft-changelog
22-
uses: jupyter-server/jupyter_releaser/.github/actions/draft-changelog@v1
23-
env:
24-
RH_IS_CHECK_RELEASE: "true"
25-
with:
26-
dry_run: true
27-
token: ${{ inputs.token }}
28-
changelog: ${{ inputs.changelog }}
29-
version_spec: ${{ inputs.version_spec }}
26+
- id: draft-changelog
27+
shell: bash -eux {0}
28+
run: |
29+
export RH_IS_CHECK_RELEASE="true"
30+
export GITHUB_ACCESS_TOKEN=${{ inputs.token }}
31+
export RH_VERSION_SPEC=${{ inputs.version_spec }}
32+
export RH_STEPS_TO_SKIP=${{ inputs.steps_to_skip }}
33+
python -m jupyter_releaser.actions.draft_changelog
3034
31-
- name: draft-release
32-
uses: jupyter-server/jupyter_releaser/.github/actions/draft-release@v1
33-
env:
34-
RH_IS_CHECK_RELEASE: "true"
35-
with:
36-
dry_run: true
37-
token: ${{ inputs.token }}
38-
changelog: ${{ inputs.changelog }}
39-
version_spec: ${{ inputs.version_spec }}
35+
- id: draft-release
36+
shell: bash -eux {0}
37+
run: |
38+
export RH_IS_CHECK_RELEASE="true"
39+
export GITHUB_ACCESS_TOKEN=${{ inputs.token }}
40+
export RH_RELEASE_URL=${{ steps.draft-changelog.outputs.release_url }}
41+
export RH_STEPS_TO_SKIP=${{ inputs.steps_to_skip }}
42+
python -m jupyter_releaser.actions.draft_release
4043
41-
- name: publish-release
42-
uses: jupyter-server/jupyter_releaser/.github/actions/publish-release@v1
43-
env:
44-
RH_IS_CHECK_RELEASE: "true"
45-
with:
46-
dry_run: true
47-
token: ${{ inputs.token }}
48-
release_url: ""
44+
- id: publish-release
45+
shell: bash -eux {0}
46+
run: |
47+
export RH_IS_CHECK_RELEASE="true"
48+
export GITHUB_ACCESS_TOKEN=${{ inputs.token }}
49+
export RH_RELEASE_URL=${{ steps.draft-changelog.outputs.release_url }}
50+
export RH_STEPS_TO_SKIP=${{ inputs.steps_to_skip }}
51+
python -m jupyter_releaser.actions.publish_release

.github/actions/draft-changelog/action.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,58 @@ inputs:
66
required: true
77
version_spec:
88
description: "New Version Specifier"
9-
required: true
9+
default: "next"
10+
required: false
11+
post_version_spec:
12+
description: "Post Version Specifier"
13+
required: false
1014
target:
1115
description: "The owner/repo GitHub target"
1216
required: true
1317
branch:
14-
description: The branch to target"
15-
required: false
16-
changelog:
17-
description: "Changelog file"
18-
default: "CHANGELOG.md"
18+
description: "The branch to target"
1919
required: false
2020
dry_run:
2121
description: "If set, do not make a PR"
2222
default: "false"
2323
required: false
2424
since:
25-
description: Use PRs with activity since this date or git reference
25+
description: "Use PRs with activity since this date or git reference"
2626
required: false
2727
since_last_stable:
28-
description: Use PRs with activity since the last stable git tag
28+
description: "Use PRs with activity since the last stable git tag"
2929
required: false
3030
outputs:
3131
pr_url:
3232
description: "The URL of the Changelog Pull Request"
3333
value: ${{ steps.draft-changelog.outputs.pr_url }}
34+
release_url:
35+
description: "The html URL of the draft GitHub release"
36+
value: ${{ steps.draft-release.outputs.release_url }}
3437
runs:
3538
using: "composite"
3639
steps:
3740
- name: install-releaser
38-
uses: jupyter-server/jupyter_releaser/.github/actions/install-releaser@v1
39-
40-
- shell: bash
41-
id: draft-changelog
41+
shell: bash -eux {0}
4242
run: |
43-
set -eux
43+
# Install Jupyter Releaser from git unless we are testing Releaser itself
44+
if ! command -v jupyter-releaser &> /dev/null
45+
then
46+
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
47+
fi
4448
45-
# Set up env variables
49+
- id: draft-changelog
50+
shell: bash -eux {0}
51+
run: |
4652
export GITHUB_ACCESS_TOKEN=${{ inputs.token }}
4753
export RH_REPOSITORY=${{ inputs.target }}
4854
if [ ! -z ${{ inputs.branch }} ]; then
4955
export RH_BRANCH=${{ inputs.branch }}
5056
fi
5157
export RH_VERSION_SPEC=${{ inputs.version_spec }}
52-
export RH_CHANGELOG=${{ inputs.changelog }}
58+
export RH_POST_VERSION_SPEC=${{ inputs.post_version_spec }}
5359
export RH_DRY_RUN=${{ inputs.dry_run }}
5460
export RH_SINCE=${{ inputs.since }}
5561
export RH_SINCE_LAST_STABLE=${{ inputs.since_last_stable }}
5662
57-
# Draft Changelog
5863
python -m jupyter_releaser.actions.draft_changelog

.github/actions/draft-release/action.yml

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,16 @@ inputs:
66
required: true
77
target:
88
description: "The owner/repo GitHub target"
9-
required: true
10-
branch:
11-
description: The branch to target
12-
required: true
13-
version_spec:
14-
description: "New Version Specifier"
15-
required: true
16-
post_version_spec:
17-
description: "Post Version Specifier"
9+
required: false
10+
release_url:
11+
description: "The full url to the GitHub release page"
1812
required: false
1913
dry_run:
2014
description: "If set, do not push permanent changes"
2115
default: "false"
2216
required: false
23-
since:
24-
description: Use PRs with activity since this date or git reference
25-
required: false
26-
since_last_stable:
27-
description: Use PRs with activity since the last stable git tag
28-
required: false
2917
steps_to_skip:
30-
description: Comma separated list of steps to skip
18+
description: "Comma separated list of steps to skip"
3119
required: false
3220

3321
outputs:
@@ -39,25 +27,20 @@ runs:
3927
using: "composite"
4028
steps:
4129
- name: install-releaser
42-
uses: jupyter-server/jupyter_releaser/.github/actions/install-releaser@v1
43-
44-
- shell: bash
45-
id: draft-release
30+
shell: bash -eux {0}
4631
run: |
47-
set -eux
32+
# Install Jupyter Releaser from git unless we are testing Releaser itself
33+
if ! command -v jupyter-releaser &> /dev/null
34+
then
35+
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
36+
fi
4837
49-
# Set up env variables
38+
- id: draft-release
39+
shell: bash -eux {0}
40+
run: |
5041
export GITHUB_ACCESS_TOKEN=${{ inputs.token }}
5142
export RH_REPOSITORY=${{ inputs.target }}
52-
if [ ! -z ${{ inputs.branch }} ]; then
53-
export RH_BRANCH=${{ inputs.branch }}
54-
fi
55-
export RH_VERSION_SPEC=${{ inputs.version_spec }}
56-
export RH_POST_VERSION_SPEC=${{ inputs.post_version_spec }}
5743
export RH_DRY_RUN=${{ inputs.dry_run }}
58-
export RH_SINCE=${{ inputs.since }}
59-
export RH_SINCE_LAST_STABLE=${{ inputs.since_last_stable }}
6044
export RH_STEPS_TO_SKIP=${{ inputs.steps_to_skip }}
61-
62-
# Draft Release
45+
export RH_RELEASE_URL=${{ inputs.release_url }}
6346
python -m jupyter_releaser.actions.draft_release

.github/actions/publish-release/action.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ inputs:
44
token:
55
description: "GitHub access token"
66
required: true
7+
target:
8+
description: "The owner/repo GitHub target"
9+
required: false
710
release_url:
811
description: "The full url to the GitHub release page"
9-
required: true
12+
required: false
1013
dry_run:
1114
description: "If set, do not push permanent changes"
1215
default: "false"
1316
required: false
1417
steps_to_skip:
15-
description: Comma separated list of steps to skip
18+
description: "Comma separated list of steps to skip"
1619
required: false
1720

1821
outputs:
@@ -27,18 +30,19 @@ runs:
2730
using: "composite"
2831
steps:
2932
- name: install-releaser
30-
uses: jupyter-server/jupyter_releaser/.github/actions/install-releaser@v1
31-
32-
- shell: bash
33-
id: publish-release
33+
shell: bash -eux {0}
34+
run: |
35+
# Install Jupyter Releaser from git unless we are testing Releaser itself
36+
if ! command -v jupyter-releaser &> /dev/null
37+
then
38+
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
39+
fi
40+
- id: publish-release
41+
shell: bash -eux {0}
3442
run: |
35-
set -eux
36-
37-
# Set up env variables
3843
export GITHUB_ACCESS_TOKEN=${{ inputs.token }}
44+
export RH_REPOSITORY=${{ inputs.target }}
3945
export RH_DRY_RUN=${{ inputs.dry_run }}
40-
export release_url=${{ inputs.release_url }}
46+
export RH_RELEASE_URL=${{ inputs.release_url }}
4147
export RH_STEPS_TO_SKIP=${{ inputs.steps_to_skip }}
42-
43-
# Publish release
4448
python -m jupyter_releaser.actions.publish_release

.github/workflows/draft-changelog.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@ name: "Step 1: Draft Changelog"
22
on:
33
workflow_dispatch:
44
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
required: true
8+
post_version_spec:
9+
description: "Post Version Specifier"
10+
required: false
511
target:
612
description: "The owner/repo GitHub target"
713
required: true
814
branch:
9-
description: "The branch to target (defaults to default branch)"
10-
required: false
11-
version_spec:
12-
description: "New Version Spec"
13-
default: "next"
15+
description: "The branch to target"
1416
required: false
1517
since:
1618
description: "Use PRs with activity since this date or git reference"
1719
required: false
1820
since_last_stable:
1921
description: "Use PRs with activity since the last stable git tag"
20-
type: boolean
2122
required: false
2223
jobs:
2324
draft_changelog:
@@ -39,6 +40,7 @@ jobs:
3940
with:
4041
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
4142
version_spec: ${{ github.event.inputs.version_spec }}
43+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
4244
target: ${{ github.event.inputs.target }}
4345
branch: ${{ github.event.inputs.branch }}
4446
since: ${{ github.event.inputs.since }}
@@ -47,5 +49,7 @@ jobs:
4749
- name: "** Next Step **"
4850
run: |
4951
echo "Review PR: ${{ steps.draft-changelog.outputs.pr_url }}"
52+
echo "Optional): Review Draft Release: ${{ steps.draft-changelog.outputs.release_url }}"
5053
echo "## Next Step" >> $GITHUB_STEP_SUMMARY
5154
echo "Review PR: ${{ steps.draft-changelog.outputs.pr_url }}" >> $GITHUB_STEP_SUMMARY
55+
echo "(Optional): Review Draft Release: ${{ steps.draft-changelog.outputs.release_url }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/draft-release.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,21 @@ on:
44
inputs:
55
target:
66
description: "The owner/repo GitHub target"
7-
required: true
8-
branch:
9-
description: "The branch to target (defaults to default branch)"
107
required: false
11-
version_spec:
12-
description: "New Version Spec"
13-
default: "next"
8+
release_url:
9+
description: "The URL of the draft GitHub release"
1410
required: false
15-
post_version_spec:
16-
description: "Post Version Specifier"
17-
required: false
18-
since:
19-
description: "Use PRs with activity since this date or git reference"
20-
required: false
21-
since_last_stable:
22-
description: "Use PRs with activity since the last stable git tag"
23-
required: false
24-
type: boolean
2511
steps_to_skip:
26-
description: "Comma separated list of steps to skip"
12+
description: "comma-separated list of steps to skip"
2713
required: false
14+
2815
jobs:
2916
draft_release:
3017
runs-on: ubuntu-latest
3118
strategy:
3219
fail-fast: true
3320
matrix:
3421
python-version: ["3.10"]
35-
env:
36-
VERSION_SPEC: ${{ github.event.inputs.version_spec }}
37-
POST_VERSION_SPEC: ${{ github.event.inputs.post_version_spec }}
3822
steps:
3923
- name: Checkout
4024
uses: actions/checkout@v2
@@ -48,11 +32,7 @@ jobs:
4832
with:
4933
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
5034
target: ${{ github.event.inputs.target }}
51-
branch: ${{ github.event.inputs.branch }}
52-
version_spec: ${{ github.event.inputs.version_spec }}
53-
post_version_spec: ${{ github.event.inputs.post_version_spec }}
54-
since: ${{ github.event.inputs.since }}
55-
since_last_stable: ${{ github.event.inputs.since_last_stable }}
35+
release_url: ${{ github.event.inputs.release_url }}
5636
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
5737

5838
- name: "** Next Step **"

0 commit comments

Comments
 (0)