Skip to content

Commit 584a07a

Browse files
kgutwinStranger6667
authored andcommitted
ci: build aarch64 Python wheels
1 parent e2e0689 commit 584a07a

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/python-release.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,41 @@ jobs:
144144
strategy:
145145
matrix:
146146
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
147-
target: [ x86_64, i686 ]
147+
target: [ x86_64, i686, aarch64 ]
148148
steps:
149149
- uses: actions/checkout@v3
150150
- uses: actions/setup-python@v4
151151
with:
152152
python-version: ${{ matrix.python-version }}
153-
architecture: x64
154153
- name: Build wheels
155154
uses: messense/maturin-action@v1
156155
with:
157156
target: ${{ matrix.target }}
158157
manylinux: auto
159158
args: --release -m bindings/python/Cargo.toml --out dist --interpreter ${{ matrix.python-version }}
160-
- name: Install built wheel
159+
- name: Install built wheel on native architecture
161160
if: matrix.target == 'x86_64'
162161
run: |
163162
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
163+
- uses: uraimo/run-on-arch-action@v2
164+
if: matrix.target == 'aarch64'
165+
name: Install built wheel on ARM architecture
166+
with:
167+
arch: ${{ matrix.target }}
168+
distro: ubuntu22.04
169+
githubToken: ${{ github.token }}
170+
install: |
171+
export TZ=UTC
172+
export DEBIAN_FRONTEND=noninteractive
173+
apt-get update
174+
apt-get install -y --no-install-recommends software-properties-common gpg gpg-agent curl
175+
add-apt-repository ppa:deadsnakes/ppa
176+
apt-get update
177+
apt-get install -y python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv
178+
run: |
179+
python${{ matrix.python-version }} -m venv venv
180+
venv/bin/pip install -U pip wheel
181+
venv/bin/pip install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
164182
- name: Upload wheels
165183
uses: actions/upload-artifact@v3
166184
with:

0 commit comments

Comments
 (0)