Skip to content

Commit

Permalink
Back to maturin action for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Mar 27, 2024
1 parent 392cbfd commit 70c8c36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/cli-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@ jobs:
path: dist

wheels-macos:
runs-on: ${{ matrix.os }}
runs-on: macos-latest
strategy:
matrix:
include:
- os: macos-13
target: x86_64
# - os: macos-14
# target: aarch64
target: [aarch64, x86_64]

steps:
- uses: actions/checkout@v4
Expand All @@ -64,22 +60,22 @@ jobs:
3.10
- name: Install build tools
run: |
pip install maturin delocate
pip install delocate
- name: Install non-Rust dependencies
run: |
brew update
brew install autoconf automake libtool
python maintainer/install-lhapdf.py
- name: Build wheels
run: |
# `--find-interpreter` is needed to generate wheels for
# *all* Python versions
maturin build --release --out dist --find-interpreter \
--manifest-path pineappl_cli/Cargo.toml
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml
sccache: "true"
- name: Patch wheels
run: |
delocate-wheel dist/*
python maintainer/patch-macos-wheel.py
python maintainer/patch-macos-wheel.py dist/*
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion maintainer/patch-macos-wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def patch(wheel: Path):
installed.write_text(WRAPPER.format(binary_path=str(binary.relative_to(tmpd))))
next(Path(tmpd).glob("**/RECORD")).write_text(record(tmpd))
shutil.make_archive(wheel.name, format="zip", base_dir=".", root_dir=tmpd)
shutil.move(str(wheel) + ".zip", wheel)
shutil.move(wheel.name + ".zip", wheel)
log.info(f"Patched {wheel} in-place")


Expand Down

0 comments on commit 70c8c36

Please sign in to comment.