-
-
Notifications
You must be signed in to change notification settings - Fork 48
210 lines (170 loc) · 4.46 KB
/
build.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: build
on:
push:
tags:
- v*
branches:
- master
pull_request:
branches:
- master
concurrency:
group: build-${{ github.head_ref }}
cancel-in-progress: true
env:
COINCURVE_UPSTREAM_REF: 1ad5185cd42c0636104129fcc9f6a4bf9c67cc40
COINCURVE_IGNORE_SYSTEM_LIB: '1'
CIBW_BEFORE_ALL_MACOS: ./.github/scripts/install-macos-build-deps.sh
CIBW_ENVIRONMENT_PASS_LINUX: >
COINCURVE_UPSTREAM_REF
COINCURVE_IGNORE_SYSTEM_LIB
CIBW_TEST_COMMAND: >
python -c
"from coincurve import PrivateKey;
a=PrivateKey();
b=PrivateKey();
assert a.ecdh(b.public_key.format())==b.ecdh(a.public_key.format())
"
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_SKIP: >
pp*
jobs:
test:
name: Test latest Python
runs-on: ubuntu-latest
env:
PYTHON_VERSION: '3.10'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Upgrade Python packaging tools
run: pip install --upgrade pip setuptools wheel
- name: Show runner information
run: |
python --version
pip --version
- name: Install dependencies
run: ./.github/scripts/install-test-deps.sh
- name: Check style and typing
run: tox -e lint,typing
- name: Run tests
run: tox -e ${PYTHON_VERSION}
- name: Run benchmarks
run: tox -e bench
- name: Upload coverage
run: codecov -X gcov
linux-wheels-standard:
name: Build Linux wheels
needs:
- test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error
macos-wheels-x86-64:
name: Build macOS wheels
needs:
- test
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error
macos-wheels-arm:
name: Build macOS wheels for ARM
needs:
- test
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: arm64
COINCURVE_CROSS_HOST: aarch64-apple-darwin
CFLAGS: -target arm64-apple-macos11
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error
windows-wheels-and-sdist:
name: Build Windows wheels and source distribution
needs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: python -m pip install --upgrade cffi
- name: Build source distribution
run: python setup.py sdist
- name: Build Windows wheels
run: ./.github/scripts/build-windows-wheels.sh
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist/*
if-no-files-found: error
linux-wheels-arm:
name: Build Linux wheels for ARM
needs:
- test
runs-on: ubuntu-20.04
if: >
github.event_name == 'push'
&&
(github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags'))
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: aarch64
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish release
needs:
- linux-wheels-standard
- macos-wheels-x86-64
- macos-wheels-arm
- windows-wheels-and-sdist
- linux-wheels-arm
runs-on: ubuntu-latest
if: >
github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
name: artifacts
path: dist
- name: Push build artifacts to PyPI
uses: pypa/[email protected]
with:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}