|
52 | 52 | targets: ${{ matrix.target }} |
53 | 53 |
|
54 | 54 | # --- Cross Compilation Setup (ARM) --- |
55 | | - - name: Install ARM cross-compiler toolchains and OpenSSL deps |
| 55 | + - name: Install cross for ARM builds |
56 | 56 | if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'armv7-unknown-linux-gnueabihf' |
57 | | - run: | |
58 | | - sudo dpkg --add-architecture arm64 |
59 | | - sudo dpkg --add-architecture armhf |
60 | | -
|
61 | | - # Add ARM-specific sources pointing to ports.ubuntu.com |
62 | | - echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/arm-cross.list |
63 | | - echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/arm-cross.list |
64 | | - echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/arm-cross.list |
65 | | -
|
66 | | - sudo apt-get update |
67 | | - sudo apt-get install -y \ |
68 | | - pkg-config \ |
69 | | - gcc-aarch64-linux-gnu \ |
70 | | - gcc-arm-linux-gnueabihf \ |
71 | | - libssl-dev:arm64 \ |
72 | | - libssl-dev:armhf |
73 | | -
|
74 | | - echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig" >> $GITHUB_ENV |
75 | | - echo "PKG_CONFIG_SYSROOT_DIR=/" >> $GITHUB_ENV |
| 57 | + run: cargo install cross --git https://github.com/cross-rs/cross |
76 | 58 |
|
77 | 59 | # --- macOS OpenSSL setup --- |
78 | 60 | - name: Install OpenSSL on macOS |
@@ -104,6 +86,10 @@ jobs: |
104 | 86 | echo "Skipping musl targets due to DBus dependency" |
105 | 87 | exit 0 |
106 | 88 | ;; |
| 89 | + aarch64-unknown-linux-gnu|armv7-unknown-linux-gnueabihf) |
| 90 | + echo "Building for ARM target ${{ matrix.target }} with cross..." |
| 91 | + cross build --release --target ${{ matrix.target }} |
| 92 | + ;; |
107 | 93 | *) |
108 | 94 | echo "Building for Linux target ${{ matrix.target }}..." |
109 | 95 | cargo build --release --target ${{ matrix.target }} |
|
0 commit comments