fix(ci): gate ring flags to linux aarch64 #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Python wheels | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| build-wheels: | |
| name: Build wheels (${{ matrix.platform }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| platform: manylinux_x86_64 | |
| target: x86_64-unknown-linux-gnu | |
| - os: ubuntu-22.04 | |
| platform: manylinux_aarch64 | |
| target: aarch64-unknown-linux-gnu | |
| - os: macos-13 | |
| platform: macos_x86_64 | |
| target: x86_64-apple-darwin | |
| - os: macos-14 | |
| platform: macos_aarch64 | |
| target: aarch64-apple-darwin | |
| - os: windows-2022 | |
| platform: windows_x86_64 | |
| target: x86_64-pc-windows-msvc | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Set ring flags (aarch64 linux) | |
| if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' && startsWith(matrix.platform, 'manylinux') }} | |
| run: | | |
| echo "RING_PREGENERATE_ASM=1" >> $GITHUB_ENV | |
| echo "CFLAGS_aarch64_unknown_linux_gnu=-march=armv8-a" >> $GITHUB_ENV | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: build | |
| args: --release --out dist -F python-ffi | |
| maturin-version: "1.5.1" | |
| manylinux: auto | |
| target: ${{ matrix.target }} | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.platform }} | |
| path: dist/*.whl | |
| sdist: | |
| name: Build sdist | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Build sdist | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: sdist | |
| args: --out dist -F python-ffi | |
| maturin-version: "1.5.1" | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz |