Skip to content

Commit 2946b74

Browse files
committed
Build Android wheels
1 parent adf3053 commit 2946b74

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
include:
3131
- archs: auto
3232
platform: auto
33+
- os: android-intel
34+
runs-on: ubuntu-latest
35+
platform: android
36+
- os: android-arm
37+
runs-on: macos-latest
38+
platform: android
3339
- os: ios
3440
runs-on: macos-latest
3541
platform: ios
@@ -58,12 +64,25 @@ jobs:
5864
submodules: true
5965
persist-credentials: false
6066

67+
# GitHub Actions can't currently run the Android emulator on macOS.
68+
- name: Skip Android tests on macOS
69+
if: matrix.os == 'android-arm'
70+
run: echo "CIBW_TEST_COMMAND=" >> "$GITHUB_ENV"
71+
72+
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
73+
- name: Enable KVM for Android emulator
74+
if: matrix.os == 'android-intel'
75+
run: |
76+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
77+
sudo udevadm control --reload-rules
78+
sudo udevadm trigger --name-match=kvm
79+
6180
- name: Build wheels
6281
uses: pypa/cibuildwheel@ffd835cef18fa11522f608fc0fa973b89f5ddc87 # 3.1.0
6382
env:
6483
CIBW_ENABLE: pypy pypy-eol
6584
CIBW_PLATFORM: ${{ matrix.platform }}
66-
CIBW_ARCHS: ${{ matrix.archs }}
85+
CIBW_ARCHS: ${{ matrix.archs || 'auto' }}
6786
MAXMINDDB_REQUIRE_EXTENSION: 1
6887

6988
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)