Skip to content

Commit 9b8ad06

Browse files
authored
Release python package workflow
1 parent ccdfb9c commit 9b8ad06

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Upload Python Package
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
release-build:
7+
runs-on: ubuntu-latest
8+
9+
permissions:
10+
id-token: write
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.11"
18+
19+
- name: Install build tools
20+
run: |
21+
pip install setuptools wheel twine
22+
23+
- name: Build package
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
27+
- name: Upload distributions
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: release-dists
31+
path: dist/
32+
33+
- name: Publish to PyPI
34+
env:
35+
TWINE_USERNAME: __token__
36+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
37+
run: |
38+
twine upload dist/*

0 commit comments

Comments
 (0)