Skip to content

Commit

Permalink
Update check-release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcarlos committed Apr 18, 2023
1 parent fcaafc7 commit 4316e3e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 32 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,21 @@ permissions:
jobs:
check_release:
runs-on: ubuntu-latest
strategy:
matrix:
group: [check_release, link_check]
python-version: ["3.9"]
node-version: ["18.x"]
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 Links
if: ${{ matrix.group == 'link_check' }}
uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1

- name: Check Release
if: ${{ matrix.group == 'check_release' }}
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Distributions
if: ${{ matrix.group == 'check_release' }}
uses: actions/upload-artifact@v3
with:
name: jupyter-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
path: |
.jupyter_releaser_checkout/dist
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,28 @@
],
"scripts": {
"build": "jlpm run build:lib && jlpm run build:labextension:dev",
"build:lib": "tsc --sourceMap",
"build:lib:prod": "tsc",
"build:prod": "jlpm run clean && jlpm run build:lib:prod && jlpm run build:labextension",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc -b",
"build:prod": "jlpm run build:lib && jlpm run build:labextension",
"build:docs": "cd docs/ && make html",
"clean": "jlpm run clean:lib",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"clean:labextension": "rimraf ../../voila_gridstack/labextension",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:labextension": "rimraf ../../jupyter_collaboration/labextension",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension && rimraf node_modules",
"develop": "python scripts/develop.py --link",
"eslint": "eslint . --ext .ts,.tsx --fix",
"eslint:check": "eslint . --ext .ts,.tsx",
"install:dev": "jlpm run build:prod",
"install:extension": "jlpm run build",
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"test": "jest --coverage",
"uninstall": "python scripts/develop.py --unlink",
"watch": "run-p watch:src watch:labextension",
"watch:labextension": "jupyter labextension watch .",
"watch:src": "tsc -w"
"watch:src": "tsc -w",
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyter-widgets/base": "^6.0.4",
Expand Down
32 changes: 21 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dynamic = ["version", "description", "authors", "urls", "keywords"]
[project.optional-dependencies]
dev = [
"click",
"jupyter_releaser~=0.9",
"jupyter_releaser",
"hatch",
"hatch-nodejs-version"
]
Expand All @@ -50,6 +50,10 @@ source = "nodejs"
[tool.hatch.metadata.hooks.nodejs]
fields = ["description", "authors", "urls"]

[tool.hatch.build.targets.sdist]
artifacts = ["/voila_gridstack/labextension", "/voila_gridstack/nbextension", "/voila_gridstack/template", "/voila_gridstack/config"]
exclude = ["/.github", "/binder", "node_modules"]

[tool.hatch.build.targets.wheel.shared-data]
"voila_gridstack/config/jpserver-voila-gridstack.json" = "etc/jupyter/jupyter_server_config.d/jpserver-voila-gridstack.json"
"voila_gridstack/config/nbserver-voila-gridstack.json" = "etc/jupyter/jupyter_notebook_config.d/nbserver-voila-gridstack.json"
Expand All @@ -59,29 +63,35 @@ fields = ["description", "authors", "urls"]
"voila_gridstack/nbextension" = "share/jupyter/nbextensions/voila-gridstack"
"voila_gridstack/template" = "share/jupyter/nbconvert/templates/gridstack"

[tool.hatch.build.targets.sdist]
exclude = [".github"]

[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder>=0.6.2"]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = ["voila_gridstack/labextension/static/style.js", "voila_gridstack/labextension/package.json"]
skip-if-exists = ["voila_gridstack/labextension/static/style.js"]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
npm = ["jlpm"]

[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
build_cmd = "build"
npm = ["jlpm"]
build_cmd = "build:prod"
editable_build_cmd = "install:extension"

[tool.jupyter-releaser]
skip = ["check-links"]

[tool.jupyter-releaser.hooks]
before-build-npm = ["python -m pip install jupyterlab~=3.6", "jlpm", "jlpm build:prod"]
before-build-python = ["jlpm clean:all"]
before-build-npm = [
"python -m pip install jupyterlab~=3.6",
"jlpm",
"jlpm build:prod"
]
before-build-python = [
# Build the assets
"jlpm build:prod",
# Clean the build artifacts to not include them in sdist
"jlpm clean:lib"
]

[tool.jupyter-releaser.options]
version_cmd = "hatch version"

[tool.check-wheel-contents]
ignore = ["W002"]

0 comments on commit 4316e3e

Please sign in to comment.