-
Notifications
You must be signed in to change notification settings - Fork 17
76 lines (66 loc) · 1.89 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build Package
on:
push:
pull_request:
release:
types:
- published
jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Create sdist
shell: bash -l {0}
run: |
python -m pip install -q build
python -m build -s
- name: Upload sdist to build artifacts
uses: actions/upload-artifact@v3
with:
name: sdist
path: dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *-i686"
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
upload_to_pypi:
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
steps:
- name: Download sdist artifact
uses: actions/download-artifact@v3
with:
name: sdist
path: dist
- name: Download wheels artifact
uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Publish package to Test PyPI
if: github.event.action != 'published' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.pypi_password }}