Skip to content

Commit cafe00c

Browse files
authored
Update release scripts to user trusted publisher (#768)
1 parent b4f786b commit cafe00c

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

.github/workflows/prep-release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
post_version_spec:
1313
description: "Post Version Specifier"
1414
required: false
15+
silent:
16+
description: "Set a placeholder in the changelog and don't publish the release."
17+
required: false
18+
type: boolean
1519
since:
1620
description: "Use PRs with activity since this date or git reference"
1721
required: false
@@ -22,18 +26,20 @@ on:
2226
jobs:
2327
prep_release:
2428
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
2531
steps:
2632
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
2733

2834
- name: Prep Release
2935
id: prep-release
30-
uses: fcollonval/jupyter_releaser/.github/actions/prep-release@1e5300b94b842e61d4f10bed0db8e855c8fe9108
31-
env:
32-
RH_TAG_FORMAT: "{version}"
36+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
3337
with:
34-
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
38+
token: ${{ secrets.GITHUB_TOKEN }}
3539
version_spec: ${{ github.event.inputs.version_spec }}
40+
silent: ${{ github.event.inputs.silent }}
3641
post_version_spec: ${{ github.event.inputs.post_version_spec }}
42+
target: ${{ github.event.inputs.target }}
3743
branch: ${{ github.event.inputs.branch }}
3844
since: ${{ github.event.inputs.since }}
3945
since_last_stable: ${{ github.event.inputs.since_last_stable }}

.github/workflows/publish-release.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,23 @@ on:
1515
jobs:
1616
publish_release:
1717
runs-on: ubuntu-latest
18+
environment: release
1819
permissions:
19-
# This is useful if you want to use PyPI trusted publisher
20-
# and NPM provenance
2120
id-token: write
2221
steps:
2322
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
2423

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+
2530
- name: Populate Release
2631
id: populate-release
27-
uses: fcollonval/jupyter_releaser/.github/actions/populate-release@1e5300b94b842e61d4f10bed0db8e855c8fe9108
28-
env:
29-
RH_TAG_FORMAT: "{version}"
32+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
3033
with:
31-
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
34+
token: ${{ steps.app-token.outputs.token }}
3235
branch: ${{ github.event.inputs.branch }}
3336
release_url: ${{ github.event.inputs.release_url }}
3437
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
@@ -37,10 +40,9 @@ jobs:
3740
id: finalize-release
3841
env:
3942
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40-
RH_TAG_FORMAT: "{version}"
41-
uses: fcollonval/jupyter_releaser/.github/actions/finalize-release@1e5300b94b842e61d4f10bed0db8e855c8fe9108
43+
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
4244
with:
43-
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
45+
token: ${{ steps.app-token.outputs.token }}
4446
release_url: ${{ steps.populate-release.outputs.release_url }}
4547

4648
- name: "** Next Step **"

0 commit comments

Comments
 (0)