-
Notifications
You must be signed in to change notification settings - Fork 50
285 lines (241 loc) · 9.15 KB
/
release.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: release
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- "main"
- "nanobind"
- "next"
tags:
- "*"
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
env:
name: freud
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
build_wheels:
name: Build wheels [${{ matrix.python.version }}, ${{ matrix.os.base }}-${{ matrix.os.arch }}]
runs-on: ${{ matrix.os.base }}-${{ matrix.os.version }}
strategy:
fail-fast: false
matrix:
os:
- base: ubuntu
version: latest
arch: 'x86_64'
# - base: windows
# version: latest
# arch: 'amd64'
- base: macos
version: 14
arch: 'arm64'
- base: macos
version: 13
arch: 'x86_64'
python:
# Pinned versions installed in CIBW_TEST_REQIURES are kept. Those defined installed in
# CIBW_BEFORE_TEST are often upgraded when the wheel is installed. This means we can't
# store the pinned requirements in a requirements file.
# Generate these version sets with commands like this:
# echo -e "numpy==1.21.6\nscipy\ngsd\nmatplotlib\nsympy" | uv pip compile --python-platform linux --python-version 3.9 --only-binary :all: - --resolution=lowest --no-deps
- version: 'cp39'
oldest_numpy: '1.22.4'
oldest_scipy: '1.7.3'
oldest_gsd: '2.5.0'
oldest_matplotlib: '3.5.0'
oldest_pytest: '8.2.1'
oldest_sympy: '1.10'
- version: 'cp310'
oldest_numpy: '1.22.4'
oldest_scipy: '1.7.3'
oldest_gsd: '2.7.0'
oldest_matplotlib: '3.5.0'
oldest_pytest: '8.2.1'
oldest_sympy: '1.10'
- version: 'cp311'
oldest_numpy: '1.23.2'
oldest_scipy: '1.9.2'
oldest_gsd: '2.7.0'
oldest_matplotlib: '3.6.0'
oldest_pytest: '8.2.1'
oldest_sympy: '1.10'
- version: 'cp312'
oldest_numpy: '1.26.2'
oldest_scipy: '1.11.2'
oldest_gsd: '3.2.0'
oldest_matplotlib: '3.7.3'
oldest_pytest: '8.2.1'
oldest_sympy: '1.10'
- version: 'cp313'
oldest_numpy: '2.1.2'
oldest_scipy: '1.14.1'
oldest_gsd: '3.4.1'
oldest_matplotlib: '3.9.2'
oldest_pytest: '8.2.1'
oldest_sympy: '1.10'
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: "recursive"
- name: Build wheels
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
env:
CIBW_BUILD: "${{ matrix.python.version }}-*"
CIBW_SKIP: "{pp*,*-musllinux_*}"
# Build only on 64-bit architectures.
CIBW_ARCHS: auto64
# Configure environment variables.
CIBW_ENVIRONMENT_LINUX: "CMAKE_PREFIX_PATH=/project/tbb LD_LIBRARY_PATH=/project/tbb/lib/intel64/gcc4.8:$LD_LIBRARY_PATH CMAKE_ARGS=-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=True"
CIBW_ENVIRONMENT_MACOS: "CMAKE_PREFIX_PATH=/Users/runner/work/freud/freud/tbb:/Users/runner/work/tbb-install CMAKE_ARGS=-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=True"
MACOSX_DEPLOYMENT_TARGET: "11.0"
# Set up TBB.
CIBW_BEFORE_BUILD_LINUX: "source .github/workflows/cibuildwheel-before-build.sh {package} linux"
CIBW_BEFORE_BUILD_MACOS: "source .github/workflows/cibuildwheel-before-build.sh {package} macos"
CIBW_BEFORE_BUILD_WINDOWS: "powershell .github/workflows/cibuildwheel-before-build.ps1 {package}"
# Test the wheels.
CIBW_TEST_REQUIRES: >
pytest==${{ matrix.python.oldest_pytest }}
sympy==${{ matrix.python.oldest_sympy }}
numpy==${{ matrix.python.oldest_numpy }}
scipy==${{ matrix.python.oldest_scipy }}
gsd==${{ matrix.python.oldest_gsd }}
matplotlib==${{ matrix.python.oldest_matplotlib }}
# Test only the currently ported modules
CIBW_TEST_COMMAND: "cd {package}/tests && pytest test_box_box.py test_parallel.py test_locality_*.py test_data.py test_pmft.py test_util.py test_msd_msd.py test_interface.py test_order_*.py test_cluster.py test_diffraction_*.py -v --log-level=DEBUG"
# CIBW_TEST_COMMAND: "cd {package}/tests && pytest . -v --log-level=DEBUG"
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: dist-${{ matrix.os.base }}-${{ matrix.os.version }}-${{ matrix.python.version }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.13"
- name: Set up Python environment
uses: glotzerlab/workflows/setup-uv@e130dd2814c7db5635babe4427dedcbd5aab76d4 # 0.5.0
with:
lockfile: ".github/workflows/environments/requirements-build-sdist.txt"
- name: Build sdist
run: python -m build --installer uv --sdist --outdir dist/ .
- name: Check sdist size
run: du -hs dist/*
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: dist-sdist
path: dist/*.tar.gz
upload_pypi:
name: Publish [PyPI]
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
concurrency: upload
steps:
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
merge-multiple: 'true'
pattern: dist-*
path: dist
- name: Check files
run: ls -lR dist
- name: Upload to PyPI
# upload to PyPI on every tag starting with 'v'
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Slack notification
if: startsWith(github.ref, 'refs/tags/v') || failure()
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
with:
status: ${{ job.status }}
channel: '#dev-freud'
source:
name: Build source tarball
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: code
submodules: true
- name: Determine filename-safe ref from GITHUB_REF_NAME
run: echo ref="$(echo "${GITHUB_REF_NAME}" | sed -e 's/\//-/g')" >> "$GITHUB_ENV"
- name: Copy source
run: cp -R code "${name}-${ref}"
- name: Remove .git
run: rm -rf "${name}-${ref}/.git"
- name: Remove examples data
run: rm -rf "${name}-${ref}/doc/source/gettingstarted/examples" && ls -laR "${name}-${ref}"
- name: Tar/zstd source
run: tar --zstd -cvf "${name}-${ref}.tar.zst" "${name}-${ref}"
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: source
path: |
*.tar.*
release-notes:
name: Extract release notes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: code
- name: Write release-notes.md
# 1. Search for the content from the start of the file to the 2nd version heading.
# 2. Remove the 2nd version heading.
# 3. Search for the content after the first version heading (removes any description at the
# start of the file.
# 4. Remove the 1st version heading.
# This leaves the content of the release notes for the current release.
run: >
grep -P -m 2 -B 10000 "^## v*\d*\.\d*\.\d*" ChangeLog.md |
sed '$d' |
grep -P -A 10000 "^## v*\d*\.\d*\.\d*" |
sed '1d' |
tee "${GITHUB_WORKSPACE}/release-notes.md"
working-directory: code
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: release-notes
path: |
release-notes.md
publish_github:
name: Publish [GitHub]
needs: [release-notes, source]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
merge-multiple: true
- name: List files
run: ls -lR
- name: Create release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
*.zst
body_path: release-notes.md
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}