Skip to content

Commit

Permalink
Merge pull request #326 from blink1073/use-releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Nov 21, 2022
2 parents fa581d8 + 3d9b81c commit 74e8d8b
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 61 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/enforce-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Enforce PR label

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
42 changes: 42 additions & 0 deletions .github/workflows/prep-release.yml
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 }}"
54 changes: 54 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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
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:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
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 }}
50 changes: 0 additions & 50 deletions .github/workflows/release_publish.yml

This file was deleted.

46 changes: 45 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
codecov
- run: hatch version 100.100.100

pre-commit:
pre_commit:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -115,3 +115,47 @@ jobs:
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1

check_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install Dependencies
run: |
pip install -e .
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

check_links:
name: Check Links
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
with:
ignore_glob: "tests/*.ipynb"

tests_check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- tests
- pre_commit
- docs
- test_minimum_versions
- test_prereleases
- check_links
- check_release
- 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) }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
(changelog)=

<!-- <START NEW CHANGELOG ENTRY> -->

# Changes in nbformat

## 5.7.0

- Always use jsonschema to handle error reporting.
- Fix deprecation warning suggestion.

<!-- <END NEW CHANGELOG ENTRY> -->

## 5.6.1

- Fix handling of `__version__` on Python 3.7.
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# The Jupyter Notebook Format

[![codecov.io](https://codecov.io/github/jupyter/nbformat/coverage.svg?branch=master)](https://codecov.io/github/jupyter/nbformat?branch=master)
[![Code Health](https://landscape.io/github/jupyter/nbformat/master/landscape.svg?style=flat)](https://landscape.io/github/jupyter/nbformat/master)
![CI Tests](https://github.com/jupyter/nbformat/workflows/Run%20tests/badge.svg)

`nbformat` contains the reference implementation of the [Jupyter Notebook format],
Expand Down
17 changes: 8 additions & 9 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

## Prerequisites

- First check that the docs/changelog.rst is up to date for the next release version

- If you have a schema version change, you need to bump the schema version manually:
First copy `nbformat/v4/nbformat/.v4.schema.json` to `nbformat/v4/nbformat/.v4.<new_minor_version_here>schema.json`.
Then edit the top of `nbformat/v4/nbbase.py`:
Expand All @@ -29,7 +27,14 @@

If you do one of these steps but not the others it will fail many tests.

## Update version
## Automated Release

The recommended way to make a release is to use [`jupyter_releaser`](https://github.com/jupyter-server/jupyter_releaser) from this repository.

- Run the "Step 1: Prep Release" workflow with the appropriate inputs.
- Review the changelog in the draft GitHub release created in Step 1.

## Manual Release

We use [hatch](https://hatch.pypa.io/latest/version/) to manage versions.

Expand All @@ -48,12 +53,6 @@ git push upstream master
git push upstream --tags
```

## Publish packages

PyPI and NPM packages will be built and published on CI when a tag is pushed.

## Manual publish procedure

### Push to PyPI

```bash
Expand Down

0 comments on commit 74e8d8b

Please sign in to comment.