Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build ARM Mac extension on M1 runners #366

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Generate Build ID (release)
Expand Down Expand Up @@ -62,10 +62,10 @@ jobs:
target: arm-unknown-linux-gnueabihf
code-target: linux-armhf
arch: armv7
- os: macos-11
- os: macos-latest
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-11
- os: macos-latest-xlarge
target: aarch64-apple-darwin
code-target: darwin-arm64

Expand All @@ -81,11 +81,19 @@ jobs:
fetch-depth: ${{ env.FETCH_DEPTH }}

# Install Python dependencies (including Ruff's native binary).
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- run: python -m pip install -t ./bundled/libs --implementation py --no-deps --upgrade -r ./requirements.txt
if: ${{ !startsWith(matrix.os, 'ubuntu') || startsWith(matrix.target, 'x86_64') }}

# ARM builds on macOS, which should select Ruff's universal binary.
- run: arch -arm64 python -m pip install -t ./bundled/libs --implementation py --no-deps --upgrade -r ./requirements.txt
if: ${{ startsWith(matrix.os, 'macos') && startsWith(matrix.target, 'aarch64') }}

# x86_64 builds on macOS, which should select Ruff's x86_64 binary.
- run: arch -x86_64 python -m pip install -t ./bundled/libs --implementation py --no-deps --upgrade -r ./requirements.txt
if: ${{ startsWith(matrix.os, 'macos') && startsWith(matrix.target, 'x86_64') }}

# ARM builds on Ubuntu, which should select Ruff's ARM binary.
- uses: uraimo/run-on-arch-action@v2
if: ${{ startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.target, 'x86_64') }}
with:
Expand All @@ -98,6 +106,10 @@ jobs:
run: |
python3 -m pip install -t ./bundled/libs --implementation py --no-deps --upgrade -r ./requirements.txt

# Every other architecture, which should defer to `pip` without any special treatment.
- run: python -m pip install -t ./bundled/libs --implementation py --no-deps --upgrade -r ./requirements.txt
if: ${{ !startsWith(matrix.os, 'macos') && (!startsWith(matrix.os, 'ubuntu') || startsWith(matrix.target, 'x86_64')) }}

# Install Node.
- name: Install Node.js
uses: actions/setup-node@v3
Expand Down