-
Notifications
You must be signed in to change notification settings - Fork 107
155 lines (128 loc) · 4.17 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
name: Build wheels and sdist and upload to PyPI
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_linux_wheels:
name: Build wheels on standard linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "*manylinux*"
CIBW_ARCHS: auto64
CIBW_SKIP: cp36* cp37* pp*
# I think yum might always work here. But leave all options available.
CIBW_BEFORE_ALL: yum install -y fftw-devel || apt-get install libfftw3-dev || apk add --upgrade fftw-dev
- uses: actions/upload-artifact@v4
with:
name: whl-linux
path: ./wheelhouse/*.whl
build_musl_wheels:
name: Build wheels on musl linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "*musllinux*"
CIBW_ARCHS: auto64
CIBW_SKIP: cp36* cp37* pp*
# I think musl always uses apk, but keep all options available.
CIBW_BEFORE_ALL: apk add --upgrade fftw-dev || apt-get install libfftw3-dev || yum install -y fftw-devel
- uses: actions/upload-artifact@v4
with:
name: whl-musl
path: ./wheelhouse/*.whl
build_macosx_intel_wheels:
name: Build wheels on MacOS Intel
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "*macosx*"
CIBW_ARCHS: auto64
CIBW_SKIP: cp36* cp37* pp*
CIBW_BEFORE_ALL: brew install fftw || true
- uses: actions/upload-artifact@v4
with:
name: whl-macos
path: ./wheelhouse/*.whl
build_macosx_arm_wheels:
name: Build wheels on MacOS ARM
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "*macosx*"
CIBW_ARCHS: arm64
CIBW_SKIP: cp36* cp37* pp*
CIBW_BEFORE_ALL: brew install llvm libomp fftw eigen
CIBW_ENVIRONMENT: >-
CC=/opt/homebrew/opt/llvm/bin/clang
CXX=/opt/homebrew/opt/llvm/bin/clang++
LDFLAGS="-L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib"
CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
PATH="/opt/homebrew/opt/llvm/bin:$PATH"
FFTW_DIR="/opt/homebrew/lib"
- uses: actions/upload-artifact@v4
with:
name: whl-arm
path: ./wheelhouse/*.whl
build_sdist:
name: Build sdist and upload to PyPI
needs: [build_linux_wheels, build_musl_wheels, build_macosx_intel_wheels, build_macosx_arm_wheels]
# Just need to build sdist on a single machine
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/GalSim
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install fftw
run: |
sudo -H apt update -y
sudo -H apt install -y libfftw3-dev
- name: Install dependencies
run: |
python -m pip install -U pip
pip install -U numpy setuptools
pip install -U -r requirements.txt
- name: Download wheels
uses: actions/download-artifact@v4
with:
path: ./wheels
pattern: whl-*
merge-multiple: true
- name: Build sdist
run: |
python setup.py sdist
ls -l dist
tar tvfz dist/GalSim-*.tar.gz
- name: Copy wheels
run: |
echo ls -l wheels
ls -l wheels
cp wheels/*.whl dist
echo ls -l dist
ls -l dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true