forked from ukaea/UDA
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (122 loc) · 5.03 KB
/
build_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
name: build and upload wheels
on:
push:
branches:
- feature/python-wheels
jobs:
build_wheels:
# name: build wheels on ${{matrix.os}} ${{matrix.arch}}
name: build wheels on ${{matrix.build-platform[0]}} ${{matrix.build-platform[1]}}
# runs-on: ${{matrix.os}}
runs-on: ${{matrix.build-platform[0]}}
strategy:
fail-fast: false
matrix:
build-platform:
# - [ubuntu-latest, x86_64, manylinux2014_x86_64]
# - [ubuntu-latest, aarch64, manylinux2014_aarch64]
- [ubuntu-latest,x86_64,manylinux_2_28_x86_64]
- [ubuntu-latest,aarch64,manylinux_2_28_aarch64]
# python:
# ["cp36", "cp37", "cp38", "cp39", "cp310", "cp311"]
# include:
# - os: ubuntu-latest
# arch: x86_64
# - os: ubuntu-latest
# arch: aarch64
# - os: macOS-latest
# arch: x86_64
# - os: macOS-latest
# arch: arm64
# - os: windows-latest
# arch: x86_64
# - os: windows-latest
# arch: AMD64
# - os: windows-latest
# arch: ARM64
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: x86_64 arm64
- name: Build manylinux2014 wheels
if: startswith(matrix.build-platform[2], 'manylinux2014')
uses: pypa/cibuildwheel@v2.17.0
env:
BIBW_ARCHS: ${{matrix.build-platform[1]}}
BIBW_BUILD: cp*-${{matrix.build-platform[2]}}
BIBW_SKIP: cp12-*
CIBW_BEFORE_ALL: >
yum update -y
yum install -y wget openssl-devel libxml2-devel libtirpc-devel
cd /tmp
wget https://github.com/fmtlib/fmt/archive/refs/tags/10.0.0.tar.gz
tar xzf 10.0.0.tar.gz
cd fmt-10.0.0
cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON
cmake --build build -j --config Release --target install
d /tmp
wget https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz
tar xzf v1.11.0.tar.gz
cd spdlog-1.11.0
cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON
cmake --build build -j --config Release --target install
cd /tmp
wget https://github.com/capnproto/capnproto/archive/refs/tags/v0.10.4.tar.gz
tar xzf v0.10.4.tar.gz
cd capnproto-0.10.4
cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON
cmake --build build
cmake --install build
cd /tmp
wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz
tar xzf boost_1_80_0.tar.gz
cd boost_1_80_0
./bootstrap.sh --prefix=/usr/local
./b2 --without-python --prefix=/usr/local install
cd /project
cmake -B build -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=OFF -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON
cmake --build build -j --config Release --target install
CIBW_BEFORE_BUILD: pip install cython six numpy
- name: Build manylinux_2_28 wheels
if: startswith(matrix.build-platform[2], 'manylinux_2_28')
uses: pypa/cibuildwheel@v2.17.0
env:
BIBW_ARCHS: ${{matrix.build-platform[1]}}
BIBW_BUILD: cp*-${{matrix.build-platform[2]}}
BIBW_SKIP: cp12-* *-manylinux2014*
CIBW_BEFORE_ALL: >
dnf update -y
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y boost-devel openssl-devel libxml2-devel libtirpc-devel
dnf install -y fmt fmt-devel spdlog spdlog-devel capnproto capnproto-devel
cd /project
cmake -B build -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=OFF -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON
cmake --build build -j --config Release --target install
cp -r /usr/local/python_installer/* /project
ls /project
CIBW_BEFORE_BUILD: pip install cython six numpy
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
upload_pypi:
needs: build_wheels
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/projects/ukaea-pyuda/