Skip to content

Commit 292e865

Browse files
committedFeb 11, 2025
add publish workflow
1 parent 2349167 commit 292e865

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
 

‎.github/workflows/publish.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Python Package
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*" # Runs only when a tag like v1.0.0 is pushed
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out the repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.9"
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install build twine setuptools setuptools-scm wheel
25+
26+
- name: Build package
27+
run: python -m build
28+
29+
- name: Publish to PyPI
30+
env:
31+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
32+
run: |
33+
twine upload --non-interactive --username __token__ --password "$PYPI_API_TOKEN" dist/*

0 commit comments

Comments
 (0)