File tree Expand file tree Collapse file tree 1 file changed +11
-36
lines changed
Expand file tree Collapse file tree 1 file changed +11
-36
lines changed Original file line number Diff line number Diff line change @@ -3,18 +3,13 @@ name: Build and Publish to PyPI
33on :
44 push :
55 branches :
6- - main
6+ - main
77 release :
88 types : [created]
99
1010jobs :
11- build-wheels :
12- name : Build wheels on ${{ matrix.os }}
13- runs-on : ${{ matrix.os }}
14- strategy :
15- matrix :
16- os : [ubuntu-latest, windows-latest, macOS-latest]
17- python-version : ['3.8', '3.9', '3.10', '3.11']
11+ build-and-publish :
12+ runs-on : ubuntu-latest
1813 steps :
1914 - uses : actions/checkout@v3
2015
@@ -23,36 +18,16 @@ jobs:
2318 with :
2419 python-version : ' 3.x'
2520
26- - name : Install cibuildwheel
27- run : python -m pip install cibuildwheel
28-
29- - name : Build wheels
30- run : python -m cibuildwheel --output-dir wheelhouse
31-
32- - uses : actions/upload-artifact@v2
33- with :
34- path : ./wheelhouse/*.whl
35-
36- publish :
37- needs : build-wheels
38- runs-on : ubuntu-latest
39- if : github.event_name == 'release' && github.event.action == 'created'
40- steps :
41- - uses : actions/download-artifact@v2
42- with :
43- name : artifact
44- path : dist
45-
46- - name : Set up Python
47- uses : actions/setup-python@v2
48- with :
49- python-version : ' 3.x'
50-
51- - name : Install twine
52- run : python -m pip install twine
21+ - name : Build wheel
22+ run : |
23+ python -m pip install --upgrade build
24+ python -m build
5325
5426 - name : Publish to PyPI
55- run : twine upload dist/*
27+ if : github.event_name == 'release' && github.event.action == 'created'
28+ run : |
29+ python -m pip install --upgrade twine
30+ twine upload dist/*
5631 env :
5732 TWINE_USERNAME : __token__
5833 TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments