-
Notifications
You must be signed in to change notification settings - Fork 14
109 lines (99 loc) · 3.13 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
name: Build Python wheels
on:
push:
branches: [master]
tags: "*"
pull_request:
# Check all PR
concurrency:
group: wheels-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
matrix:
include:
- name: x86_64 Linux
os: ubuntu-20.04
rust-target: x86_64-unknown-linux-gnu
cibw_arch: x86_64
- name: x86_64 macOS
os: macos-11
rust-target: x86_64-apple-darwin
cibw_arch: x86_64
- name: M1 macOS
os: macos-11
rust-target: aarch64-apple-darwin
cibw_arch: arm64
- name: x86_64 Windows
os: windows-2019
# TODO: add a 32-bit windows builder?
rust-target: x86_64-pc-windows-msvc
cibw_arch: AMD64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.rust-target }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: install dependencies
run: python -m pip install cibuildwheel
- name: build manylinux with rust docker image
if: matrix.os == 'ubuntu-20.04'
run: docker build -t rustc-manylinux2014_x86_64 python/scripts/rustc-manylinux2014_x86_64
- name: build rascaline wheel
run: python -m cibuildwheel .
env:
CIBW_BUILD: cp310-*
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BUILD_VERBOSITY: 2
CIBW_MANYLINUX_X86_64_IMAGE: rustc-manylinux2014_x86_64
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude libmetatensor.so -w {dest_dir} {wheel}"
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
- name: upload wheel to GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: ./wheelhouse/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-sdist:
runs-on: ubuntu-20.04
name: sdist
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: build sdist
run: |
pip install wheel
python setup.py sdist
- uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.tar.gz
- name: upload sdist to GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}