From 35546b3b9f3656ed50e3405ad275642c41ff1d82 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 8 May 2024 10:00:27 +0800 Subject: [PATCH] fix building for different targets (fix #22) --- .github/workflows/publish.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ba098eb..f3e66f5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: settings: - host: macos-latest target: x86_64-apple-darwin - build: cargo build --release + build: cargo build --target=${{ matrix.settings.target }} --release - host: macos-14 target: aarch64-apple-darwin build: | @@ -25,16 +25,16 @@ jobs: export CXX=$(xcrun -f clang++); SYSROOT=$(xcrun --sdk macosx --show-sdk-path); export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; - cargo build --release + cargo build --target=${{ matrix.settings.target }} --release - host: ubuntu-latest target: x86_64-unknown-linux-gnu - build: cargo build --release + build: cargo build --target=${{ matrix.settings.target }} --release - host: ubuntu-latest target: x86_64-unknown-linux-musl - build: cargo build --release + build: cargo build --target=${{ matrix.settings.target }} --release - host: windows-latest target: x86_64-pc-windows-gnu - build: cargo build --release + build: cargo build --target=${{ matrix.settings.target }} --release name: ${{ matrix.settings.target }} runs-on: ${{ matrix.settings.host }} steps: @@ -65,6 +65,7 @@ jobs: ls -l cd .. - name: Pack + if: matrix.settings.host == 'windows-latest' shell: pwsh run: | if (Test-Path dist) {