-
Notifications
You must be signed in to change notification settings - Fork 11
81 lines (76 loc) · 2.75 KB
/
manual_build_maturin_macos.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
name: manual_build_maturin_macos
on:
workflow_dispatch:
inputs:
py_interface_folder:
description: "Location of the py interface folder"
required: true
type: string
deploy:
description: "Determines if build python wheels should be deployed to PyPi"
required: false
default: false
type: boolean
universal2:
description: "Build python wheels with universal2 flag"
required: false
default: true
type: boolean
jobs:
build_maturin_builds_macos:
name: maturin_build-macos-${{ matrix.python.interpreter }}
runs-on: 'macOS-latest'
strategy:
matrix:
python: [
{py: '3.10', interpreter: "python3.10"},
{py: '3.11', interpreter: "python3.11"}
]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: "aarch64-apple-darwin"
default: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.py }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip pytest numpy twine
python -m pip install maturin
- name: macos wheels
if: ${{ inputs.universal2 == false || matrix.python.py == '3.7'}}
run: |
RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" maturin build -i ${{ matrix.python.interpreter }} --out wheels -m ${{inputs.py_interface_folder}}/Cargo.toml --release --locked
- name: universal wheels
if: ${{ inputs.universal2 && matrix.python.py != '3.7' }}
run: |
RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" maturin build -i ${{ matrix.python.interpreter }} --out wheels -m ${{inputs.py_interface_folder}}/Cargo.toml --release --locked --target x86_64-apple-darwin
RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" maturin build -i ${{ matrix.python.interpreter }} --out wheels -m ${{inputs.py_interface_folder}}/Cargo.toml --release --locked --target aarch64-apple-darwin
- name: store artifact
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheels
deploy:
if: ${{inputs.deploy}}
needs: build_maturin_builds_macos
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m pip install --upgrade pip
pip install twine
python -m twine upload --skip-existing *