-
Notifications
You must be signed in to change notification settings - Fork 0
196 lines (181 loc) · 6.37 KB
/
ci.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
release:
types: published
jobs:
tar_gz:
name: Package
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: 3.12
- run: pip install -r requirements-build-3_12.txt
- run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
matrix_config:
name: Matrix Runner Config
runs-on: ubuntu-22.04
outputs:
matrix_os: ${{ steps.step.outputs.matrix_os }}
steps:
- run: echo "$GITHUB_EVENT_NAME"
- id: step
run: |
if [ "$GITHUB_EVENT_NAME" = "release" ]; then
echo 'matrix_os=["macos-13-xlarge", "ubuntu-22.04", "windows-2022"]' >> $GITHUB_OUTPUT
else
echo 'matrix_os=["macos-13", "ubuntu-22.04", "windows-2022"]' >> $GITHUB_OUTPUT
fi
whl_3_8:
name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
needs: matrix_config
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(needs.matrix_config.outputs.matrix_os) }}
minor: [8]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
- run: echo '::add-matcher::.github/problem-matchers/gcc.json'
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
- run: echo '::add-matcher::.github/problem-matchers/msvc.json'
if: startsWith(matrix.os, 'windows-')
- uses: pypa/[email protected]
if: matrix.os != 'macos-13-xlarge'
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
CIBW_ARCHS_WINDOWS: x86 AMD64
CIBW_ARCHS_MACOS: x86_64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_08.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_08.txt
CIBW_TEST_COMMAND: pytest {project}
- run: pip install pipx
if: matrix.os == 'macos-13-xlarge'
- uses: pypa/[email protected]
if: matrix.os == 'macos-13-xlarge'
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-macosx_arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_08.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_08.txt
CIBW_TEST_COMMAND: pytest {project}/test
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
whl_3_9_to_3_11:
name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
needs: matrix_config
strategy:
fail-fast: false
matrix:
os: ${{fromJson(needs.matrix_config.outputs.matrix_os)}}
minor: [9, 10, 11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
- run: echo '::add-matcher::.github/problem-matchers/gcc.json'
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
- run: echo '::add-matcher::.github/problem-matchers/msvc.json'
if: startsWith(matrix.os, 'windows-')
- uses: pypa/[email protected]
if: matrix.os != 'macos-13-xlarge'
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
CIBW_ARCHS_WINDOWS: x86 AMD64
CIBW_ARCHS_MACOS: x86_64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_11.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_11.txt
CIBW_TEST_COMMAND: pytest {project}
- run: pip install pipx
if: matrix.os == 'macos-13-xlarge'
- uses: pypa/[email protected]
if: matrix.os == 'macos-13-xlarge'
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-macosx_arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_11.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_11.txt
CIBW_TEST_COMMAND: pytest {project}/test
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
whl_3_12:
name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
needs: matrix_config
strategy:
fail-fast: false
matrix:
os: ${{fromJson(needs.matrix_config.outputs.matrix_os)}}
minor: [12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
- run: echo '::add-matcher::.github/problem-matchers/gcc.json'
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
- run: echo '::add-matcher::.github/problem-matchers/msvc.json'
if: startsWith(matrix.os, 'windows-')
- run: pip install pipx
if: startsWith(matrix.os, 'macos-')
- uses: pypa/[email protected]
if: matrix.os != 'macos-13-xlarge'
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
CIBW_ARCHS_WINDOWS: x86 AMD64
CIBW_ARCHS_MACOS: x86_64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_12.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_12.txt
CIBW_TEST_COMMAND: pytest {project}
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- run: pip install pipx
if: matrix.os == 'macos-13-xlarge'
- uses: pypa/[email protected]
if: matrix.os == 'macos-13-xlarge'
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-macosx_arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_12.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_12.txt
CIBW_TEST_COMMAND: pytest {project}/test
upload:
name: Publish
if: github.event_name == 'release'
needs: [tar_gz, whl_3_8, whl_3_9_to_3_11, whl_3_12]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true