Step 2: Publish Release #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Step 2: Publish Release" | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "The target branch" | |
required: false | |
release_url: | |
description: "The URL of the draft GitHub release" | |
required: false | |
steps_to_skip: | |
description: "Comma separated list of steps to skip" | |
required: false | |
jobs: | |
publish_release: | |
runs-on: ubuntu-latest | |
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 | |
- run: pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v2 | |
- id: populate-release | |
shell: bash -eux {0} | |
run: | | |
export GITHUB_ACCESS_TOKEN=${{ secrets.ADMIN_GITHUB_TOKEN }} | |
export GITHUB_ACTOR=alanhamlett | |
export RH_STEPS_TO_SKIP=${{ github.event.inputs.steps_to_skip }} | |
export RH_RELEASE_URL=${{ github.event.inputs.release_url }} | |
export RH_BRANCH=${{ github.event.inputs.branch }} | |
python -m jupyter_releaser.actions.populate_release | |
- id: finalize-release | |
shell: bash -eux {0} | |
run: | | |
export NPM_TOKEN=${{ secrets.NPM_TOKEN }} | |
export GITHUB_ACCESS_TOKEN=${{ secrets.ADMIN_GITHUB_TOKEN }} | |
export GITHUB_ACTOR=alanhamlett | |
export RH_RELEASE_URL=${{ steps.populate-release.outputs.release_url }} | |
export RH_STEPS_TO_SKIP=${{ github.event.inputs.steps_to_skip }} | |
export RH_BRANCH=${{ github.event.inputs.branch }} | |
python -m jupyter_releaser.actions.finalize_release | |
- if: ${{ success() }} | |
shell: bash -eux {0} | |
run: | | |
echo "## Next Step" >> $GITHUB_STEP_SUMMARY | |
echo "Verify the final release" >> $GITHUB_STEP_SUMMARY | |
echo ${{ steps.finalize-release.outputs.release_url }} >> $GITHUB_STEP_SUMMARY | |
if [ ! -z "${{ steps.finalize-release.outputs.pr_url }}" ]; then | |
echo "Merge the forwardport PR" | |
echo ${{ steps.finalize-release.outputs.pr_url }} | |
echo "Merge the forwardport PR" >> $GITHUB_STEP_SUMMARY | |
echo ${{ steps.finalize-release.outputs.pr_url }} >> $GITHUB_STEP_SUMMARY | |
fi | |
- if: ${{ failure() }} | |
shell: bash -eux {0} | |
run: | | |
echo "## Failure Message" >> $GITHUB_STEP_SUMMARY | |
echo ":x: Failed to Publish the Draft Release Url:" >> $GITHUB_STEP_SUMMARY | |
echo ${{ inputs.release_url }} >> $GITHUB_STEP_SUMMARY |