Skip to content

Commit

Permalink
Build linux-aarch64 packages on GitHub arm runners instead of using e…
Browse files Browse the repository at this point in the history
…mulation
  • Loading branch information
mstimberg committed Jan 24, 2025
1 parent d112ba0 commit 3173b1b
Showing 1 changed file with 49 additions and 14 deletions.
63 changes: 49 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,8 @@ jobs:

build-linux:
needs: [get_python_versions]
name: Build ${{ matrix.arch }} 🎡 and source 📦 on Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [ auto64, aarch64 ]
name: Build x86_64 🎡 and source 📦 on Linux
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -85,12 +81,7 @@ jobs:
- name: Build source tarball
run: |
python -m pip install --upgrade pip build
python -m build --sdist --config-setting=--formats=gztar --config-setting=--with-cython --config-setting=--fail-on-error
if: ${{ matrix.arch == 'auto64' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
python -m build --sdist --config-setting=--formats=gztar --config-setting=--with-cython --config-setting=--fail-on-error
- name: Install platformdirs
run: python -m pip install platformdirs
- name: Display cibuildwheel cache dir
Expand All @@ -111,8 +102,52 @@ jobs:
uses: pypa/[email protected]
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ needs.get_python_versions.outputs.min-python }}"
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_LINUX: auto64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_TEST_COMMAND: python {project}/dev/continuous-integration/run_simple_test.py
CIBW_TEST_REQUIRES: pytest
with:
output-dir: dist
- name: store distribution 📦
uses: actions/upload-artifact@v4
with:
name: packages-linux-auto64
path: dist

build-linux-arm:
needs: [get_python_versions]
name: Build aarch64 🎡 on Linux
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install platformdirs
run: python -m pip install platformdirs
- name: Display cibuildwheel cache dir
id: cibuildwheel-cache
run: |
from platformdirs import user_cache_path
import os
with open(os.getenv('GITHUB_OUTPUT'), 'w') as f:
f.write(f"dir={str(user_cache_path(appname='cibuildwheel', appauthor='pypa'))}")
shell: python
- name: Cache cibuildwheel tools
uses: actions/cache@v4
with:
path: ${{ steps.cibuildwheel-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.arch }}-cibuildwheel
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ needs.get_python_versions.outputs.min-python }}"
CIBW_ARCHS_LINUX: aarch64
CIBW_SKIP: 'pp* *-musllinux_aarch64'
CIBW_TEST_COMMAND: python {project}/dev/continuous-integration/run_simple_test.py
CIBW_TEST_REQUIRES: pytest
Expand All @@ -121,7 +156,7 @@ jobs:
- name: store distribution 📦
uses: actions/upload-artifact@v4
with:
name: packages-linux-${{ matrix.arch }}
name: packages-linux-aarch64
path: dist

deploy_dev:
Expand Down

0 comments on commit 3173b1b

Please sign in to comment.