From 881a692880785f64ddec59db9fdc8984699b88b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Thu, 16 Nov 2023 14:43:55 -0800 Subject: [PATCH] cli: Build for more targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It can come in handy to have blazecli readily build for more targets, especially for Android, where it can be especially painful to get a working build from scratch. This change adjusts the build workflow to use a proper cross compilation setup that makes it easy for us to accomplish the same. With that in hand, it adds builds for a few Android targets. Signed-off-by: Daniel Müller --- .github/workflows/build.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abb8c2fe..9bb7b5a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,22 +5,26 @@ on: jobs: build: - name: Build statically linked binary + name: Build runs-on: ubuntu-latest + strategy: + matrix: + # Please update the test workflow cross-compile matrix when adding a new + # target here. + target: [ + aarch64-linux-android, + arm-linux-androideabi, + armv7-linux-androideabi, + x86_64-unknown-linux-musl, + ] steps: - uses: actions/checkout@v4 - - name: Install dependencies - run: sudo apt-get install musl-tools - - uses: actions-rs/toolchain@v1 + - uses: taiki-e/setup-cross-toolchain-action@v1 with: - toolchain: stable - profile: minimal - override: true - target: x86_64-unknown-linux-musl + target: ${{ matrix.target }} - run: | - cargo install --path=cli --root=. --target x86_64-unknown-linux-musl - strip bin/blazecli + cargo install --path=cli --root=. --target ${{ matrix.target }} - uses: actions/upload-artifact@v3 with: - name: blazecli + name: blazecli-${{ matrix.target }} path: bin/blazecli