Skip to content

Commit b8fe9d0

Browse files
authored
Add workflows for simplified publish (#993)
* Add workflows for simplified publish * target prod pypi
1 parent afb1af0 commit b8fe9d0

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

.github/workflows/prep-release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
since:
13+
description: "Use PRs with activity since this date or git reference"
14+
required: false
15+
since_last_stable:
16+
description: "Use PRs with activity since the last stable git tag"
17+
required: false
18+
type: boolean
19+
jobs:
20+
prep_release:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: true
24+
matrix:
25+
python-version: ["3.10"]
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Setup
31+
uses: jupyter-server/jupyter-releaser/.github/actions/common@version2
32+
33+
- name: Prep Release
34+
id: prep-release
35+
uses: jupyter-server/jupyter-releaser/.github/actions/prep-release@version2
36+
with:
37+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
38+
version_spec: ${{ github.event.inputs.version_spec }}
39+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
40+
target: ${{ github.repository }}
41+
branch: ${{ github.event.inputs.branch }}
42+
since: ${{ github.event.inputs.since }}
43+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
44+
45+
- name: "** Next Step **"
46+
run: |
47+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"
48+
echo "## Next Step" >> $GITHUB_STEP_SUMMARY
49+
echo "(Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}" >> $GITHUB_STEP_SUMMARY
50+
echo "Run Publish Release Workflow" >> $GITHUB_STEP_SUMMARY

.github/workflows/publish-release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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+
strategy:
19+
fail-fast: true
20+
matrix:
21+
python-version: ["3.10"]
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Setup
27+
uses: jupyter-server/jupyter-releaser/.github/actions/common@version2
28+
29+
- name: Populate Release
30+
id: populate-release
31+
uses: jupyter-server/jupyter-releaser/.github/actions/populate-release@version2
32+
with:
33+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
34+
target: ${{ github.repository }}
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+
env:
42+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
43+
TWINE_USERNAME: __token__
44+
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@version2
45+
with:
46+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
47+
target: ${{ github.repository }}
48+
release_url: ${{ steps.populate-release.outputs.release_url }}
49+
50+
- name: "** Next Step **"
51+
if: ${{ success() }}
52+
run: |
53+
echo "Verify the final release"
54+
echo ${{ steps.finalize-release.outputs.release_url }}
55+
echo "## Next Step" >> $GITHUB_STEP_SUMMARY
56+
echo "Verify the final release" >> $GITHUB_STEP_SUMMARY
57+
echo ${{ steps.finalize-release.outputs.release_url }} >> $GITHUB_STEP_SUMMARY
58+
if [ ! -z "${{ steps.finalize-release.outputs.pr_url }}" ]; then
59+
echo "Merge the forwardport PR"
60+
echo ${{ steps.finalize-release.outputs.pr_url }}
61+
echo "Merge the forwardport PR" >> $GITHUB_STEP_SUMMARY
62+
echo ${{ steps.finalize-release.outputs.pr_url }} >> $GITHUB_STEP_SUMMARY
63+
fi
64+
65+
- name: "** Failure Message **"
66+
if: ${{ failure() }}
67+
run: |
68+
echo "Failed to Publish the Draft Release Url:"
69+
echo ${{ steps.populate-release.outputs.release_url }}
70+
echo "## Failure Message" >> $GITHUB_STEP_SUMMARY
71+
echo ":x: Failed to Publish the Draft Release Url:" >> $GITHUB_STEP_SUMMARY
72+
echo ${{ steps.populate-release.outputs.release_url }} >> $GITHUB_STEP_SUMMARY
73+
echo "Fix credentials and run 'Publish Release' workflow again" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)