Skip to content

Commit

Permalink
Arm64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
d.rudenko committed Oct 16, 2024
1 parent c60c9c6 commit cca4e81
Showing 1 changed file with 46 additions and 12 deletions.
58 changes: 46 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # Supported Python versions
arch: [x86_64, arm64] # Add architecture matrix

steps:
- name: Checkout the repository
Expand All @@ -34,27 +33,62 @@ jobs:
toolchain: stable
components: rustfmt

- name: Build and publish wheels for Linux ARM
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
maturin publish --target aarch64-unknown-linux-gnu --skip-existing --username __token__
- name: Publish to PyPI on macOS and Linux
if: matrix.os != 'Windows' && matrix.arch == 'x86_64'
if: runner.os != 'Windows'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
maturin publish --skip-existing --username __token__
- name: Publish to PyPI on Windows
if: runner.os == 'Windows' && matrix.arch == 'x86_64'
if: runner.os == 'Windows'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
# Install Visual Studio Build Tools for Rust on Windows
choco install visualstudio2019buildtools --version=16.11.7
maturin publish --skip-existing --username __token__
# Add a separate job for ARM builds
build-arm:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # Supported Python versions
platform: [arm64]

steps:
- name: Checkout the repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install qemu binfmt-support qemu-user-static
- name: Set up Docker Buildx
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --use
- name: Install maturin
run: |
python -m pip install --upgrade pip
pip install maturin
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt

- name: Build and publish for ARM
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
maturin publish --skip-existing --username __token__

0 comments on commit cca4e81

Please sign in to comment.