-
Notifications
You must be signed in to change notification settings - Fork 12
182 lines (163 loc) · 4.86 KB
/
wheels.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
---
# Workflow to build wheels.
name: Wheel builder
on: workflow_dispatch
jobs:
build_wheels:
name: Build wheel for ${{ matrix.python }}-${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# manylinux builds
- os: ubuntu-20.04
python: "cp39"
platform: manylinux_x86_64
- os: ubuntu-20.04
python: "cp310"
platform: manylinux_x86_64
- os: ubuntu-20.04
python: "cp311"
platform: manylinux_x86_64
- os: ubuntu-20.04
python: "cp312"
platform: manylinux_x86_64
- os: ubuntu-20.04
python: "cp313"
platform: manylinux_x86_64
# manylinux pypy builds
- os: ubuntu-20.04
python: "pp39"
platform: manylinux_x86_64
- os: ubuntu-20.04
python: "pp310"
platform: manylinux_x86_64
# MacOS builds - intel
- os: macos-12
python: "cp39"
platform: macosx_x86_64
- os: macos-12
python: "cp310"
platform: macosx_x86_64
- os: macos-12
python: "cp311"
platform: macosx_x86_64
- os: macos-12
python: "cp312"
platform: macosx_x86_64
- os: macos-12
python: "cp313"
platform: macosx_x86_64
# MacOS PyPy builds
- os: macos-12
python: "pp39"
platform: macosx_x86_64
- os: macos-12
python: "pp310"
platform: macosx_x86_64
# MacOS arm64
- os: macos-14
python: "cp39"
platform: macosx_arm64
- os: macos-14
python: "cp310"
platform: macosx_arm64
- os: macos-14
python: "cp311"
platform: macosx_arm64
- os: macos-14
python: "cp312"
platform: macosx_arm64
- os: macos-14
python: "cp313"
platform: macosx_arm64
# Windows builds
- os: windows-2019
python: "cp39"
platform: win_amd64
- os: windows-2019
python: "cp310"
platform: win_amd64
- os: windows-2019
python: "cp311"
platform: win_amd64
- os: windows-2019
python: "cp312"
platform: win_amd64
- os: windows-2019
python: "cp313"
platform: win_amd64
# Windows PyPy builds
- os: windows-2019
python: "pp39"
platform: win_amd64
- os: windows-2019
python: "pp310"
platform: win_amd64
steps:
- name: Checkout xcsf
uses: actions/checkout@v4
with:
submodules: true
- name: Set MACOSX_DEPLOYMENT_TARGET
if: runner.os == 'macOS'
run: |
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
echo "MACOSX_DEPLOYMENT_TARGET=12.0" >> $GITHUB_ENV
elif [[ "${{ matrix.os }}" == "macos-14" ]]; then
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
fi
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL_MACOS: CC=gcc-12 CXX=g++-12
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BUILD_VERBOSITY: 3
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ env.MACOSX_DEPLOYMENT_TARGET }}
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout xcsf
uses: actions/checkout@v4
with:
submodules: true
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload:
runs-on: ubuntu-latest
# if: github.event_name == 'release' && github.event.action == 'published'
needs: [build_wheels, build_sdist]
environment:
name: pypi
url: https://pypi.org/p/xcsf
permissions:
id-token: write
contents: read
attestations: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: "dist/*"
- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
# repository-url: https://test.pypi.org/legacy/
...