-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the need for an ADMIN_GITHUB_TOKEN #557
Changes from 5 commits
6a29d5b
6f94806
d22394b
67de800
e491e83
f5f86c1
9730dc7
8b028ac
3eed246
cfd814c
f0078a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,10 @@ on: | |
post_version_spec: | ||
description: "Post Version Specifier" | ||
required: false | ||
# silent: | ||
# description: "Set a placeholder in the changelog and don't publish the release." | ||
# required: false | ||
# type: boolean | ||
silent: | ||
description: "Set a placeholder in the changelog and don't publish the release." | ||
required: false | ||
type: boolean | ||
since: | ||
description: "Use PRs with activity since this date or git reference" | ||
required: false | ||
|
@@ -27,51 +27,69 @@ on: | |
description: "Comma separated list of steps to skip during Populate Release" | ||
required: false | ||
jobs: | ||
full_release: | ||
prep_release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# This is useful if you want to use PyPI trusted publisher | ||
# and NPM provenance | ||
id-token: write | ||
contents: write | ||
steps: | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Prep Release | ||
id: prep-release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
version_spec: ${{ github.event.inputs.version_spec }} | ||
silent: ${{ github.event.inputs.silent }} | ||
post_version_spec: ${{ github.event.inputs.post_version_spec }} | ||
target: ${{ github.event.inputs.target }} | ||
branch: ${{ github.event.inputs.branch }} | ||
# silent: ${{ github.event.inputs.silent }} | ||
since: ${{ github.event.inputs.since }} | ||
since_last_stable: ${{ github.event.inputs.since_last_stable }} | ||
|
||
publish_release: | ||
needs: [prep_release] | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Populate Release | ||
id: populate-release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
token: ${{ steps.app-token.outputs.token }} | ||
target: ${{ github.event.inputs.target }} | ||
branch: ${{ github.event.inputs.branch }} | ||
release_url: ${{ steps.prep-release.outputs.release_url }} | ||
release_url: ${{ github.event.inputs.release_url }} | ||
steps_to_skip: ${{ github.event.inputs.steps_to_skip }} | ||
|
||
- name: Finalize Release | ||
id: finalize-release | ||
env: | ||
# The following are needed if you use legacy PyPI set up | ||
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
# PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }} | ||
# TWINE_USERNAME: __token__ | ||
Comment on lines
-63
to
-66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we keep this for now as we don't remove legacy PyPI publication yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think having it in the docs is enough, new projects should be using Trusted Publishing. |
||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
token: ${{ steps.app-token.outputs.token }} | ||
target: ${{ github.event.inputs.target }} | ||
release_url: ${{ steps.populate-release.outputs.release_url }} | ||
|
||
- name: "** Next Step **" | ||
if: ${{ success() }} | ||
run: | | ||
echo "Verify the final release" | ||
echo ${{ steps.finalize-release.outputs.release_url }} | ||
|
||
- name: "** Failure Message **" | ||
if: ${{ failure() }} | ||
run: | | ||
echo "Failed to Publish the Draft Release Url:" | ||
echo ${{ steps.populate-release.outputs.release_url }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,10 @@ on: | |
post_version_spec: | ||
description: "Post Version Specifier" | ||
required: false | ||
# silent: | ||
# description: "Set a placeholder in the changelog and don't publish the release." | ||
# required: false | ||
# type: boolean | ||
silent: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iirc this was left commented so that the input does not show up in the UI as this is more of an advanced feature (discussed in #526) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay fair, I'll comment it out |
||
description: "Set a placeholder in the changelog and don't publish the release." | ||
required: false | ||
type: boolean | ||
since: | ||
description: "Use PRs with activity since this date or git reference" | ||
required: false | ||
|
@@ -26,18 +26,21 @@ on: | |
jobs: | ||
prep_release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Prep Release | ||
id: prep-release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
version_spec: ${{ github.event.inputs.version_spec }} | ||
silent: ${{ github.event.inputs.silent }} | ||
post_version_spec: ${{ github.event.inputs.post_version_spec }} | ||
target: ${{ github.event.inputs.target }} | ||
branch: ${{ github.event.inputs.branch }} | ||
# silent: ${{ github.event.inputs.silent }} | ||
since: ${{ github.event.inputs.since }} | ||
since_last_stable: ${{ github.event.inputs.since_last_stable }} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,33 +15,34 @@ on: | |
jobs: | ||
publish_release: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
# This is useful if you want to use PyPI trusted publisher | ||
# and NPM provenance | ||
id-token: write | ||
steps: | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Populate Release | ||
id: populate-release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
token: ${{ steps.app-token.outputs.token }} | ||
branch: ${{ github.event.inputs.branch }} | ||
release_url: ${{ github.event.inputs.release_url }} | ||
steps_to_skip: ${{ github.event.inputs.steps_to_skip }} | ||
|
||
- name: Finalize Release | ||
id: finalize-release | ||
env: | ||
# The following are needed if you use legacy PyPI set up | ||
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
# PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }} | ||
# TWINE_USERNAME: __token__ | ||
Comment on lines
-37
to
-40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment |
||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
token: ${{ steps.app-token.outputs.token }} | ||
release_url: ${{ steps.populate-release.outputs.release_url }} | ||
|
||
- name: "** Next Step **" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we advice to allow that environment only on protected branches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, updated