@@ -3,10 +3,11 @@ name: Build Python Wheels
33on :
44 # allow manual runs
55 workflow_dispatch :
6+
67 # run when we tag a release
7- release :
8- types :
9- - " created"
8+ # release:
9+ # types:
10+ # - "created"
1011
1112env :
1213 BUILD_TYPE : Release
@@ -29,15 +30,14 @@ jobs:
2930 - name : Build sdist
3031 run : python -m build --sdist --outdir dist
3132
32- - uses : actions/upload-artifact@v2
33+ - uses : actions/upload-artifact@v3
3334 with :
3435 path : dist/*.tar.gz
3536
3637 build_wheels :
3738 name : ${{ matrix.config.name }}
3839 runs-on : ${{ matrix.config.os }}
3940 strategy :
40- # fail-fast: false
4141 matrix :
4242 config :
4343 - {
5555 os : ubuntu-latest,
5656 cibw-arch : manylinux_x86_64
5757 }
58+ - {
59+ name : " Ubuntu Latest (ARM64)" ,
60+ os : ubuntu-latest,
61+ cibw-arch : manylinux_aarch64,
62+ use-qemu : true
63+ }
5864 - {
5965 name : " Ubuntu Latest (i686)" ,
6066 os : ubuntu-latest,
6672 cibw-arch : win_amd64
6773 }
6874
69-
7075 steps :
7176 - name : Checkout
7277 uses : actions/checkout@v3
@@ -75,25 +80,27 @@ jobs:
7580 uses : actions/setup-python@v4
7681 with :
7782 python-version : ' 3.x'
78-
83+
84+ - name : Set up QEMU for linux/arm64 builds
85+ if : runner.os == 'Linux' && matrix.config.use-qemu == true
86+ uses : docker/setup-qemu-action@v2
87+ with :
88+ platforms : arm64
89+
7990 - name : Install Python dependencies
80- run : python -m pip install cibuildwheel==2.5.0
81-
82- - name : Configure cibuildwheel
83- shell : bash
84- run : |
85- CMAKE_OSX_ARCHITECTURES=${{ matrix.config.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.config.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.config.cibw-arch == 'macosx_universal2' && '"arm64;x86_64"' || '' }}
86- echo "CIBW_ARCHS_MACOS=x86_64 arm64" >> $GITHUB_ENV
87- echo "CIBW_BUILD=*-${{ matrix.config.cibw-arch }}" >> $GITHUB_ENV
88- echo "CIBW_ENVIRONMENT_MACOS=CMAKE_OSX_ARCHITECTURES=\"$CMAKE_OSX_ARCHITECTURES\"" >> $GITHUB_ENV
89-
91+ run : python -m pip install cibuildwheel==2.12.0
92+
9093 - name : Build wheels
9194 run : python -m cibuildwheel --output-dir dist
9295 env :
96+ CIBW_ARCHS_LINUX : " auto aarch64"
97+ CIBW_ARCHS_MACOS : " x86_64 arm64"
98+ CIBW_ENVIRONMENT_MACOS : CMAKE_OSX_ARCHITECTURES=${{ matrix.config.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.config.cibw-arch == 'macosx_arm64' && 'arm64' || '' }}
99+ CIBW_BUILD : " *-${{ matrix.config.cibw-arch }}"
93100 CIBW_BEFORE_BUILD_LINUX : " yum remove -y cmake"
94101 CIBW_BEFORE_BUILD : " python -m pip install cmake>=3.18"
95- CIBW_SKIP : " *-win32 pp*-macosx* "
102+ CIBW_SKIP : " *-win32 pp*-aarch64 pp*-macosx "
96103
97- - uses : actions/upload-artifact@v2
104+ - uses : actions/upload-artifact@v3
98105 with :
99106 path : ./dist/*.whl
0 commit comments