Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/prepare-release-auto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Prepare Release (Auto)

on:
workflow_dispatch:
inputs:
bump:
description: Version bump type
required: true
default: patch
type: choice
options:
- patch
- minor
- major

permissions:
contents: write

concurrency:
group: prepare-release-${{ github.ref }}
cancel-in-progress: false

jobs:
prepare_release:
name: Prepare Release
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'master' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup JupyterLab Maintainer Tools
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: "3.11"
pnpm_version: "10"
python_package_manager: "uv pip"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "jupyterlab>=4.0.0,<5" hatch

- name: Bump package version
id: bump
env:
BUMP_TYPE: ${{ github.event.inputs.bump }}
run: |
python - <<'PY'
import json
import os
from pathlib import Path

bump = os.environ["BUMP_TYPE"]
package_json = Path("package.json")
data = json.loads(package_json.read_text())

major, minor, patch = map(int, data["version"].split("."))
if bump == "major":
major, minor, patch = major + 1, 0, 0
elif bump == "minor":
minor, patch = minor + 1, 0
elif bump == "patch":
patch += 1
else:
raise ValueError(f"Unsupported bump type: {bump}")

new_version = f"{major}.{minor}.{patch}"
data["version"] = new_version
package_json.write_text(json.dumps(data, indent=2) + "\n")

with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as fh:
fh.write(f"new_version={new_version}\n")
PY

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run lint
run: pnpm run lint:check

- name: Run tests
run: pnpm run test

- name: Build distribution
run: hatch build
Comment on lines +86 to +88
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo’s documented/CI build path is python -m build (RELEASE.md:39-40, .github/workflows/ci.yml:87-92), but this workflow uses hatch build. Consider switching this step to python -m build so the auto-release validation uses the same build mechanism as CI/publishing (and adjust the earlier dependency install accordingly).

Copilot uses AI. Check for mistakes.

- name: Commit release version
env:
VERSION: ${{ steps.bump.outputs.new_version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json
git commit -m "chore(release): v${VERSION}"

- name: Push release commit
run: git push origin HEAD:master

- name: Create and push release tag
env:
VERSION: ${{ steps.bump.outputs.new_version }}
run: |
git tag "v${VERSION}"
git push origin "v${VERSION}"

- name: Create draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.bump.outputs.new_version }}
run: |
gh release create "v${VERSION}" \
--target master \
--draft \
--generate-notes \
--title "v${VERSION}"
2 changes: 1 addition & 1 deletion .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "jupyterlab>=4.0.0,<5" hatch jupyter_builder
python -m pip install "jupyterlab>=4.0.0,<5" hatch
- name: Build Distribution
run: hatch build
Comment on lines +30 to 32
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow builds artifacts via hatch build, but the repo’s release docs and CI use python -m build (see RELEASE.md:39-40 and .github/workflows/ci.yml:87-92). Consider switching here as well to keep the build path consistent and to avoid depending on the Hatch CLI for publishing (install build and run python -m build).

Suggested change
python -m pip install "jupyterlab>=4.0.0,<5" hatch
- name: Build Distribution
run: hatch build
python -m pip install "jupyterlab>=4.0.0,<5" build
- name: Build Distribution
run: python -m build

Copilot uses AI. Check for mistakes.
- name: Publish to TestPyPI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "jupyterlab>=4.0.0,<5" hatch jupyter_builder
python -m pip install "jupyterlab>=4.0.0,<5" hatch
- name: Build Distribution
run: hatch build
Comment on lines +28 to 30
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow builds artifacts via hatch build, but the repo’s release docs and CI use python -m build (see RELEASE.md:39-40 and .github/workflows/ci.yml:87-92). Consider switching here as well to keep the build path consistent and to avoid depending on the Hatch CLI for publishing (install build and run python -m build).

Suggested change
python -m pip install "jupyterlab>=4.0.0,<5" hatch
- name: Build Distribution
run: hatch build
python -m pip install "jupyterlab>=4.0.0,<5" build
- name: Build Distribution
run: python -m build

Copilot uses AI. Check for mistakes.
- name: Publish to PyPI
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dev = [


[build-system]
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version", "jupyter_builder"]
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version", "hatch-jupyter-builder"]
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[build-system].requires now depends on hatch-jupyter-builder without a version constraint, but the jupyter-builder hook below already declares hatch-jupyter-builder>=0.5. To avoid non-reproducible builds (and potential breakage if an older/newer incompatible plugin is resolved), align the build-system requirement with the minimum supported version (e.g., hatch-jupyter-builder>=0.5).

Suggested change
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version", "hatch-jupyter-builder"]
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version", "hatch-jupyter-builder>=0.5"]

Copilot uses AI. Check for mistakes.
build-backend = "hatchling.build"

[tool.hatch.version]
Expand Down
Loading