File tree 1 file changed +11
-36
lines changed
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
3
3
on :
4
4
push :
5
5
branches :
6
- - main
6
+ - main
7
7
release :
8
8
types : [created]
9
9
10
10
jobs :
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
18
13
steps :
19
14
- uses : actions/checkout@v3
20
15
@@ -23,36 +18,16 @@ jobs:
23
18
with :
24
19
python-version : ' 3.x'
25
20
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
53
25
54
26
- 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/*
56
31
env :
57
32
TWINE_USERNAME : __token__
58
33
TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments