Publish Python package #3
Workflow file for this run
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
name: Publish Python package | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/jupyterlab-logout | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'pip' # caching pip dependencies | |
# architecture: 'x64' | |
- name: Install test dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build hatch "jupyterlab>=4.0.0,<5" "hatch-nodejs-version" | |
- name: Lint the extension | |
run: | | |
set -eux | |
jlpm | |
jlpm run lint:check | |
- name: Build the extension | |
run: | | |
set -eux | |
python -m pip install . | |
jupyter labextension list | |
jupyter labextension list 2>&1 | grep -ie "jupyterlab-logout.*OK" | |
python -m jupyterlab.browser_check | |
- name: Build package | |
run: | | |
python -m build | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |