File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed
Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and upload to PyPI
2+
3+ on :
4+ workflow_dispatch :
5+ pull_request :
6+ push :
7+ branches :
8+ - main
9+ release :
10+ types :
11+ - published
12+
13+ jobs :
14+ build_wheels :
15+ name : Build wheels on ${{ matrix.os }}
16+ runs-on : ${{ matrix.os }}
17+ strategy :
18+ matrix :
19+ os : [ubuntu-22.04, windows-2022, macos-11]
20+
21+ steps :
22+ - uses : actions/checkout@v3
23+
24+ - name : Build wheels
25+ 26+
27+ - uses : actions/upload-artifact@v3
28+ with :
29+ path : ./wheelhouse/*.whl
30+
31+ build_sdist :
32+ name : Build source distribution
33+ runs-on : ubuntu-latest
34+ steps :
35+ - uses : actions/checkout@v3
36+
37+ - name : Build sdist
38+ run : pipx run build --sdist
39+
40+ - uses : actions/upload-artifact@v3
41+ with :
42+ path : dist/*.tar.gz
43+
44+ upload_pypi :
45+ needs : [build_wheels, build_sdist]
46+ runs-on : ubuntu-latest
47+ environment : pypi
48+ permissions :
49+ id-token : write
50+ if : github.event_name == 'release' && github.event.action == 'published'
51+ steps :
52+ - uses : actions/download-artifact@v3
53+ with :
54+ # unpacks default artifact into dist/
55+ # if `name: artifact` is omitted, the action will create extra parent dir
56+ name : artifact
57+ path : dist
58+
59+ - uses : pypa/gh-action-pypi-publish@release/v1
60+ with :
61+ repository_url : https://test.pypi.org/legacy/
You can’t perform that action at this time.
0 commit comments