Skip to content

Commit 77db79e

Browse files
auto build and upload develop pip whl to pypi when commiting (#920)
1 parent 0780c19 commit 77db79e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Python package
2+
3+
on:
4+
push:
5+
branches:
6+
- develop # Trigger the workflow on push events to the develop branch
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: [3.8, 3.9, 3.10] # List of Python versions
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install setuptools wheel twine build
28+
29+
- name: Build package
30+
run: |
31+
python -m build
32+
33+
- name: Publish package
34+
env:
35+
TWINE_USERNAME: __token__
36+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
37+
run: |
38+
twine upload dist/*

0 commit comments

Comments
 (0)