Skip to content

Commit

Permalink
WIP: cross compile for MacOS targets
Browse files Browse the repository at this point in the history
  • Loading branch information
kylc committed Dec 17, 2023
1 parent 2ad3d87 commit c27d70f
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ on: [push, pull_request, workflow_dispatch]

jobs:
build_wheels:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64
- os: macos-latest
target: x86_64
- target: x86_64-unknown-linux-gnu
- target: x86_64-apple-darwin
args: --zig
- target: aarch64-apple-darwin
args: --zig

steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: true
- name: symlink gfortran (macOS)
if: runner.os == 'macOS'
run: |
ln -s /usr/local/bin/gfortran-12 /usr/local/bin/gfortran
gfortran --version
# - name: symlink gfortran (macOS)
# if: runner.os == 'macOS'
# run: |
# ln -s /usr/local/bin/gfortran-12 /usr/local/bin/gfortran
# gfortran --version
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v4
with:
Expand All @@ -32,18 +33,19 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
args: ${{ matrix.args }} --release --out dist
manylinux: auto
sccache: true
- name: delocate wheel (macOS)
if: runner.os == 'macOS'
run: |
pip install delocate
delocate-wheel -v dist/*.whl
- name: install built wheel
run: |
pip install optik-py --no-index --find-links dist
python -c "import optik"
# - name: delocate wheel (macOS)
# if: runner.os == 'macOS'
# run: |
# pip install delocate
# delocate-wheel -v dist/*.whl
# - name: install built wheel
# if: ${{ matrix.target }} == 'x86_64-unknown-linux-gnu'
# run: |
# pip install optik-py --no-index --find-links dist
# python -c "import optik"
- name: upload wheels
uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit c27d70f

Please sign in to comment.