Skip to content

Commit

Permalink
Create publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
firezym committed Nov 19, 2024
1 parent 31115e0 commit 905f0b3
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish to PyPI

on:
push:
tags:
- 'v1.0.1' # 当推送标签时触发(如 v1.0.0)

jobs:
publish:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout Code
uses: actions/checkout@v3

# Step 2: Base setup for JupyterLab extensions
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

# Step 3: Install dependencies
- name: Install Dependencies
run: python -m pip install --upgrade pip setuptools wheel twine build

# Step 4: Lint and test your extension
- name: Lint and Test
run: |
set -eux
jlpm
jlpm run lint:check
jlpm run test
# Step 5: Build the extension package
- name: Build the Package
run: |
set -eux
python -m build
# Step 6: Publish to PyPI
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*

0 comments on commit 905f0b3

Please sign in to comment.