Skip to content

Commit 9b639d9

Browse files
committed
init
0 parents  commit 9b639d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4682
-0
lines changed

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
actions:
9+
patterns:
10+
- "*"
11+
- package-ecosystem: "pip"
12+
directory: "/"
13+
schedule:
14+
interval: "monthly"
15+
groups:
16+
pip:
17+
patterns:
18+
- "*"

.github/workflows/build.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
8+
defaults:
9+
run:
10+
shell: bash -eux {0}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, macos-latest, windows-latest]
19+
python-version: ["3.9", "3.13"]
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Base Setup
26+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
27+
28+
- name: Install the extension
29+
run: |
30+
python -m pip install ".[test]"
31+
32+
- name: Test the extension
33+
run: |
34+
pytest .
35+
36+
- name: Build the extension
37+
run: |
38+
pip install build
39+
python -m build --sdist
40+
cp dist/*.tar.gz my_server_extension.tar.gz
41+
pip uninstall -y "jupyter_mcp_server"
42+
rm -rf "jupyter_mcp_server"
43+
44+
- uses: actions/upload-artifact@v4
45+
if: startsWith(matrix.os, 'ubuntu')
46+
with:
47+
name: my_server_extension-sdist-${{ matrix.python-version }}
48+
path: my_server_extension.tar.gz
49+
50+
check_links:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
55+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
56+
57+
test_lint:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
62+
- name: Run Linters
63+
run: |
64+
bash ./.github/workflows/lint.sh
65+
66+
test_sdist:
67+
needs: build
68+
runs-on: ubuntu-latest
69+
strategy:
70+
matrix:
71+
python-version: ["3.13"]
72+
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
- name: Install Python
77+
uses: actions/setup-python@v5
78+
with:
79+
python-version: ${{ matrix.python-version }}
80+
architecture: "x64"
81+
- uses: actions/download-artifact@v4
82+
with:
83+
name: my_server_extension-sdist-${{ matrix.python-version }}
84+
- name: Install and Test
85+
run: |
86+
pip install my_server_extension.tar.gz
87+
pip list 2>&1 | grep -ie "jupyter_mcp_server"
88+
python -c "import jupyter_mcp_server"
89+
90+
check_release:
91+
needs: test_sdist
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v4
95+
- name: Base Setup
96+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
97+
- name: Install Dependencies
98+
run: |
99+
pip install -e .
100+
- name: Check Release
101+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
102+
with:
103+
token: ${{ secrets.GITHUB_TOKEN }}
104+
- name: Upload Distributions
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: jupyter_mcp_server-releaser-dist-${{ github.run_number }}
108+
path: .jupyter_releaser_checkout/dist
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Fix License Headers
2+
3+
on:
4+
pull_request_target:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
header-license-fix:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Checkout the branch from the PR that triggered the job
25+
run: gh pr checkout ${{ github.event.pull_request.number }}
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Fix License Header
30+
# pin to include https://github.com/apache/skywalking-eyes/pull/168
31+
uses: apache/skywalking-eyes/header@e19b828cea6a6027cceae78f05d81317347d21be
32+
with:
33+
mode: fix
34+
35+
- name: List files changed
36+
id: files-changed
37+
shell: bash -l {0}
38+
run: |
39+
set -ex
40+
export CHANGES=$(git status --porcelain | tee /tmp/modified.log | wc -l)
41+
cat /tmp/modified.log
42+
43+
echo "N_CHANGES=${CHANGES}" >> $GITHUB_OUTPUT
44+
45+
git diff
46+
47+
- name: Commit any changes
48+
if: steps.files-changed.outputs.N_CHANGES != '0'
49+
shell: bash -l {0}
50+
run: |
51+
git config user.name "github-actions[bot]"
52+
git config user.email "github-actions[bot]@users.noreply.github.com"
53+
54+
git pull --no-tags
55+
56+
git add *
57+
git commit -m "Automatic application of license header"
58+
59+
git config push.default upstream
60+
git push
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2023-2024 Datalayer, Inc.
3+
#
4+
# BSD 3-Clause License
5+
6+
pip install -e ".[lint, typing]"
7+
mypy --install-types --non-interactive .
8+
ruff check .
9+
mdformat --check *.md
10+
pipx run 'validate-pyproject[all]' pyproject.toml

.github/workflows/prep-release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "Step 1: Prep Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
default: "next"
8+
required: false
9+
branch:
10+
description: "The branch to target"
11+
required: false
12+
post_version_spec:
13+
description: "Post Version Specifier"
14+
required: false
15+
# silent:
16+
# description: "Set a placeholder in the changelog and don't publish the release."
17+
# required: false
18+
# type: boolean
19+
since:
20+
description: "Use PRs with activity since this date or git reference"
21+
required: false
22+
since_last_stable:
23+
description: "Use PRs with activity since the last stable git tag"
24+
required: false
25+
type: boolean
26+
jobs:
27+
prep_release:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
31+
steps:
32+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
33+
34+
- name: Prep Release
35+
id: prep-release
36+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
version_spec: ${{ github.event.inputs.version_spec }}
40+
# silent: ${{ github.event.inputs.silent }}
41+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
42+
branch: ${{ github.event.inputs.branch }}
43+
since: ${{ github.event.inputs.since }}
44+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
45+
46+
- name: "** Next Step **"
47+
run: |
48+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Step 2: Publish Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: "The target branch"
7+
required: false
8+
release_url:
9+
description: "The URL of the draft GitHub release"
10+
required: false
11+
steps_to_skip:
12+
description: "Comma separated list of steps to skip"
13+
required: false
14+
15+
jobs:
16+
publish_release:
17+
runs-on: ubuntu-latest
18+
environment: release
19+
permissions:
20+
id-token: write
21+
steps:
22+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
23+
24+
- uses: actions/create-github-app-token@v1
25+
id: app-token
26+
with:
27+
app-id: ${{ vars.APP_ID }}
28+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
29+
30+
- name: Populate Release
31+
id: populate-release
32+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
33+
with:
34+
token: ${{ steps.app-token.outputs.token }}
35+
branch: ${{ github.event.inputs.branch }}
36+
release_url: ${{ github.event.inputs.release_url }}
37+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
38+
39+
- name: Finalize Release
40+
id: finalize-release
41+
env:
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
44+
with:
45+
token: ${{ steps.app-token.outputs.token }}
46+
release_url: ${{ steps.populate-release.outputs.release_url }}
47+
48+
- name: "** Next Step **"
49+
if: ${{ success() }}
50+
run: |
51+
echo "Verify the final release"
52+
echo ${{ steps.finalize-release.outputs.release_url }}
53+
54+
- name: "** Failure Message **"
55+
if: ${{ failure() }}
56+
run: |
57+
echo "Failed to Publish the Draft Release Url:"
58+
echo ${{ steps.populate-release.outputs.release_url }}

0 commit comments

Comments
 (0)