Skip to content

Commit c01d1a5

Browse files
committed
add workflow for releasing to PyPI
1 parent 941fdfb commit c01d1a5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/package.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: build and upload pip
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- name: Check out repo
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: 3.11
20+
21+
- name: Display Python version
22+
run: python -c "import sys; print(sys.version)"
23+
24+
- name: Install dependencies
25+
run: |
26+
pip install --upgrade pip
27+
pip install setuptools wheel twine
28+
pip install pep517 --user
29+
30+
- name: Install package
31+
run: |
32+
pip install .
33+
34+
- name: Build binary wheel and source tarball
35+
run: |
36+
python -m pep517.build --source --binary --out-dir dist/ .
37+
38+
- name: Publish distribution to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
user: __token__
42+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)