-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub Actions and Prep for Release (#394)
* Update github workflows * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * update versions
- Loading branch information
Showing
31 changed files
with
362 additions
and
58 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
name: kernel gateway tests | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
defaults: | ||
run: | ||
shell: bash -eux {0} | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ["3.8", "3.11"] | ||
include: | ||
- os: macos-latest | ||
python-version: "3.9" | ||
- os: ubuntu-latest | ||
python-version: "3.12" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Run the tests | ||
timeout-minutes: 15 | ||
run: | | ||
hatch run cov:test --cov-fail-under 50 || hatch run test:test --lf | ||
- name: Show help | ||
run: | | ||
pip install . | ||
cd $HOME | ||
jupyter kernelgateway --help | ||
- uses: jupyterlab/maintainer-tools/.github/actions/upload-coverage@v1 | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/report-coverage@v1 | ||
with: | ||
fail_under: 80 | ||
|
||
test_lint: | ||
name: Test Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
- name: Run Linters | ||
run: | | ||
#hatch run typing:test | ||
hatch run lint:build | ||
pipx run interrogate -vv . | ||
pipx run doc8 --max-line-length=200 | ||
check_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
- uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
test_docs: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
- run: hatch run docs:build | ||
|
||
test_miniumum_versions: | ||
name: Test Minimum Versions | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
with: | ||
dependency_type: minimum | ||
|
||
- name: List installed packages | ||
run: | | ||
hatch run test:list | ||
- name: Run the unit tests | ||
run: | | ||
hatch run test:nowarn || hatch run test:nowarn --lf | ||
test_prereleases: | ||
name: Test Prereleases | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
with: | ||
dependency_type: pre | ||
- name: Run the tests | ||
run: | | ||
hatch run test:nowarn || hatch run test:nowarn --lf | ||
make_sdist: | ||
name: Make SDist | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1 | ||
|
||
test_sdist: | ||
runs-on: ubuntu-latest | ||
needs: [make_sdist] | ||
name: Install from SDist and Test | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1 | ||
|
||
link_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 | ||
|
||
tests_check: # This job does nothing and is only used for the branch protection | ||
if: always() | ||
needs: | ||
- coverage | ||
- test_docs | ||
- test_miniumum_versions | ||
- test_lint | ||
- test_prereleases | ||
- check_release | ||
- link_check | ||
- test_sdist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Enforce PR label | ||
|
||
concurrency: | ||
group: label-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
types: [labeled, unlabeled, opened, edited, synchronize] | ||
jobs: | ||
enforce-label: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: enforce-triage-label | ||
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "Step 1: Prep Release" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_spec: | ||
description: "New Version Specifier" | ||
default: "next" | ||
required: false | ||
branch: | ||
description: "The branch to target" | ||
required: false | ||
post_version_spec: | ||
description: "Post Version Specifier" | ||
required: false | ||
since: | ||
description: "Use PRs with activity since this date or git reference" | ||
required: false | ||
since_last_stable: | ||
description: "Use PRs with activity since the last stable git tag" | ||
required: false | ||
type: boolean | ||
jobs: | ||
prep_release: | ||
runs-on: ubuntu-latest | ||
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 }} | ||
version_spec: ${{ github.event.inputs.version_spec }} | ||
post_version_spec: ${{ github.event.inputs.post_version_spec }} | ||
target: ${{ github.event.inputs.target }} | ||
branch: ${{ github.event.inputs.branch }} | ||
since: ${{ github.event.inputs.since }} | ||
since_last_stable: ${{ github.event.inputs.since_last_stable }} | ||
|
||
- name: "** Next Step **" | ||
run: | | ||
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
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 | ||
environment: release | ||
steps: | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Populate Release | ||
id: populate-release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
target: ${{ github.event.inputs.target }} | ||
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: | ||
TWINE_USERNAME: __token__ | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_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 }} |
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Release Guide | ||
|
||
## Using `jupyter_releaser` | ||
|
||
The recommended way to make a release is to use [`jupyter_releaser`](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html). | ||
|
||
## Manual Release | ||
|
||
- Update `CHANGELOG` | ||
|
||
- Run the following: | ||
|
||
```bash | ||
export VERSION=<version> | ||
pip install pipx | ||
pipx run hatch version $VERSION | ||
git commit -a -m "Release $VERSION" | ||
git tag $VERSION; true; | ||
git push --all | ||
git push --tags | ||
rm -rf dist build | ||
pipx run build . | ||
pipx run twine check dist/* | ||
pipx run twine upload dist/* | ||
``` |
Oops, something went wrong.