This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.51 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
name: build wheels
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
detect-changes:
uses: ./.github/workflows/check_diff.yml
with:
pattern: ^crates/hyperdrivepy/
build_wheels:
needs: detect-changes
# Run only if changes are detected
# if: needs.detect-changes.outputs.changed == 'true'
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: [cp310]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: check out hyperdrive
uses: actions/checkout@master
with:
repository: delvtech/hyperdrive
ref: "v0.9.0"
path: "./hyperdrive"
ssh-key: ${{ secrets.HYPERDRIVE_ACCESS_KEY }}
- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
# NOTE: This is needed to ensure that hyperdrive-wrappers builds correctly.
- name: install foundry
uses: foundry-rs/[email protected]
with:
version: nightly
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: install python dependencies
run: python -m pip install --upgrade pip && python -m pip install --upgrade -r requirements-dev.txt
- name: build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "${{ matrix.python-version }}-*"
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$HOME/.foundry/bin:$HOME/.cargo/env:$PATH" CARGO_TERM_COLOR="always"'
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$UserProfile\.foundry\bin;$UserProfile\.cargo\env;$PATH"'
CIBW_ARCHS_LINUX: auto
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_ALL_OSX: >
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y &&
rustup show &&
rustup target add aarch64-apple-darwin &&
rustup target add x86_64-apple-darwin
CIBW_BUILD_VERBOSITY: 1
with:
output-dir: wheelhouse
package-dir: crates/hyperdrivepy
- name: upload artifacts
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl