-
Notifications
You must be signed in to change notification settings - Fork 3
97 lines (79 loc) · 2.5 KB
/
build.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
name: Rust Build with Maturin
on: [push, pull_request]
jobs:
build-linux:
name: Build Rust Project on Linux
runs-on: ubuntu-latest
container:
image: ghcr.io/pyo3/maturin
steps:
- name: Clone Repository
run: |
git config --global --add safe.directory /__w/${GITHUB_REPOSITORY#*/}/${GITHUB_REPOSITORY#*/}
git clone https://github.com/${GITHUB_REPOSITORY}.git .
git checkout ${GITHUB_SHA}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build with Maturin
run: |
yum update -y
yum install -y openssl openssl-devel perl-IPC-Cmd perl-core
rustup default stable
maturin build --release --features py --out dist
- uses: actions/upload-artifact@v4
with:
name: wheels-linux
path: dist/*
build-macos-arm:
name: Build Rust Project on macOS Arm
runs-on: macos-14
steps:
- uses: actions/checkout@v4
name: Checkout code
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
- name: Install Maturin
run: |
python -m pip install maturin
- name: Build with Maturin
run: |
maturin build --release --features py --out dist
- uses: actions/upload-artifact@v4
with:
name: wheels-macos-arm
path: dist/*
build-linux-arm64:
name: Build Rust Project on macOS Arm with Linux to make linux arm64
runs-on: macos-14
steps:
- uses: actions/checkout@v4
name: Checkout code
- name: Install Docker
run: |
brew install podman
- name: Start colima
run: |
podman machine init
podman machine start
- name: Create Dockerfile.build
run: |
cat <<EOF > Dockerfile.build
FROM ghcr.io/pyo3/maturin
RUN yum update -y && yum install -y openssl-devel
EOF
- name: Build build image
run: |
podman build -t docker.io/library/maturin-linux-arm64:latest -f Dockerfile.build .
podman run --rm -v $(pwd):/app -w /app maturin-linux-arm64 --release --features py --out dist
- uses: actions/upload-artifact@v4
with:
name: wheels-linux-arm
path: dist/*