-
Notifications
You must be signed in to change notification settings - Fork 566
136 lines (112 loc) · 3.86 KB
/
deploy.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: "Deploy Python Lib"
on:
release:
types:
- created
pull_request:
permissions:
contents: read
pull-requests: read
jobs:
build-windows-and-mac:
strategy:
matrix:
os: [windows-latest, macos-latest]
python: ['3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Build lib
run: |
pip install wheel
python setup.py develop
python setup.py bdist_wheel
- name: List contents of dist
run: ls -R dist
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-artifacts
path: dist
build-linux:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_x86_64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compile c headers
run: |
/opt/python/cp39-cp39/bin/python setup.py develop
/opt/python/cp310-cp310/bin/python setup.py develop
/opt/python/cp311-cp311/bin/python setup.py develop
/opt/python/cp312-cp312/bin/python setup.py develop
- name: Build wheel files
run: |
/opt/python/cp39-cp39/bin/python setup.py bdist_wheel
/opt/python/cp310-cp310/bin/python setup.py bdist_wheel
/opt/python/cp311-cp311/bin/python setup.py bdist_wheel
/opt/python/cp312-cp312/bin/python setup.py bdist_wheel
- name: Install auditwheel # this should be available?!
run: |
/opt/python/cp39-cp39/bin/python -m pip install auditwheel
/opt/python/cp310-cp310/bin/python -m pip install auditwheel
/opt/python/cp311-cp311/bin/python -m pip install auditwheel
/opt/python/cp312-cp312/bin/python -m pip install auditwheel
- name: Repair wheel files
run: |
/opt/python/cp39-cp39/bin/python -m auditwheel repair dist/*cp39-cp39-linux_x86_64.whl
/opt/python/cp310-cp310/bin/python -m auditwheel repair dist/*cp310-cp310-linux_x86_64.whl
/opt/python/cp311-cp311/bin/python -m auditwheel repair dist/*cp311-cp311-linux_x86_64.whl
/opt/python/cp312-cp312/bin/python -m auditwheel repair dist/*cp312-cp312-linux_x86_64.whl
- name: List contents of dist
run: ls -R dist
- name: List contests of wheelhouse
run: ls -R wheelhouse
- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
name: wheelhouse-artifacts
path: wheelhouse
deploy:
runs-on: ubuntu-latest
needs: [build-linux, build-windows-and-mac]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install twine
run: |
pip install --upgrade pip
pip install twine
- name: Download build artifacts for windows and mac wheels
uses: actions/download-artifact@v4
with:
path: dist-artifacts
merge-multiple: true
- name: Download build artifacts for manylinux wheels
uses: actions/download-artifact@v4
with:
path: wheelhouse-artifacts
merge-multiple: true
- name: Inspect dist files
run: ls -R dist
- name: Inspect wheelhouse files
run: ls -R wheelhouse
- name: Merge wheel files
run: |
cp dist/* wheelhouse/
ls -R wheelhouse
- name: Upload to PyPI using twine
run: twine upload --skip-existing wheelhouse/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}