Skip to content

Commit 19427f7

Browse files
committed
feat(ci): refine build workflow for ARM64 by adding Python 3.12 support and conditional dependency installation
1 parent 4434378 commit 19427f7

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- os: ubuntu-latest
3131
target: x86_64-unknown-linux-gnu
3232
artifact_name: rohas-linux-x86_64
33-
- os: ubuntu-latest
33+
- os: ubuntu-24.04-arm
3434
target: aarch64-unknown-linux-gnu
3535
artifact_name: rohas-linux-arm64
3636

@@ -43,13 +43,36 @@ jobs:
4343
with:
4444
targets: ${{ matrix.target }}
4545

46+
- name: Install Python
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: '3.12'
50+
4651
- name: Install cross-compilation dependencies (Linux ARM64)
47-
if: matrix.target == 'aarch64-unknown-linux-gnu'
52+
if: matrix.target == 'aarch64-unknown-linux-gnu' && matrix.os != 'ubuntu-24.04-arm'
4853
run: |
54+
sudo dpkg --add-architecture arm64
4955
sudo apt-get update
50-
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross pkg-config
56+
sudo apt-get install -y \
57+
gcc-aarch64-linux-gnu \
58+
g++-aarch64-linux-gnu \
59+
libc6-dev-arm64-cross \
60+
pkg-config \
61+
cmake \
62+
python3.12-dev \
63+
libpython3.12-dev:arm64
5164
rustup target add aarch64-unknown-linux-gnu
5265
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
66+
echo "CXX_aarch64-unknown-linux-gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
67+
echo "PYO3_CROSS_PYTHON_VERSION=3.12" >> $GITHUB_ENV
68+
echo "PYO3_CROSS_LIB_DIR=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
69+
echo "PYO3_CROSS_INCLUDE_DIR=/usr/include/aarch64-linux-gnu/python3.12" >> $GITHUB_ENV
70+
71+
- name: Install native ARM dependencies
72+
if: matrix.target == 'aarch64-unknown-linux-gnu' && matrix.os == 'ubuntu-24.04-arm'
73+
run: |
74+
sudo apt-get update
75+
sudo apt-get install -y build-essential pkg-config cmake python3.12-dev libpython3.12-dev
5376
5477
- name: Install build dependencies (for vendored OpenSSL)
5578
if: runner.os == 'Linux'

0 commit comments

Comments
 (0)