1- name : Deduplicator Build & Release CI Pipeline
1+ name : Deduplicator Release Build CI Pipeline
22
33on :
44 push :
88jobs :
99 lint_test :
1010 runs-on : ubuntu-latest
11+ env :
12+ RUSTFLAGS : " -C target-feature=+aes,+sse2"
1113 steps :
1214 - name : Checkout repository
1315 uses : actions/checkout@v4
@@ -35,15 +37,19 @@ jobs:
3537 - target : aarch64-unknown-linux-gnu
3638 os : ubuntu-latest
3739 artifact_name : linux-aarch64
40+ rustflags : " -C target-feature=+aes,+neon"
3841 - target : x86_64-unknown-linux-gnu
3942 os : ubuntu-latest
4043 artifact_name : linux-amd64
44+ rustflags : " -C target-feature=+aes,+sse2"
4145 - target : x86_64-apple-darwin
4246 os : macos-14
4347 artifact_name : macos-amd64
48+ rustflags : " -C target-feature=+aes,+sse2"
4449 - target : aarch64-apple-darwin
4550 os : macos-14
4651 artifact_name : macos-arm64
52+ rustflags : " -C target-feature=+aes,+neon"
4753
4854 steps :
4955 - name : Checkout repository
@@ -55,12 +61,31 @@ jobs:
5561 - name : Add target
5662 run : rustup target add ${{ matrix.target }}
5763
64+ - name : Install cross-compilation toolchain (Linux ARM only)
65+ if : matrix.target == 'aarch64-unknown-linux-gnu'
66+ run : |
67+ sudo apt-get update
68+ sudo apt-get install -y gcc-aarch64-linux-gnu
69+
5870 - name : Build release binary
59- run : cargo build --release --target ${{ matrix.target }}
71+ env :
72+ RUSTFLAGS : ${{ matrix.rustflags }}
73+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : ${{ matrix.target == 'aarch64-unknown-linux-gnu' && 'aarch64-linux-gnu-gcc' || '' }}
74+ run : |
75+ if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
76+ export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
77+ fi
78+ cargo build --release --target ${{ matrix.target }}
6079
6180 - name : Package binary
6281 run : |
63- BINARY_NAME=$(basename $(find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable | head -1))
82+ if [[ "${{ matrix.os }}" == macos* ]]; then
83+ BINARY_NAME=$(find target/${{ matrix.target }}/release -maxdepth 1 -type f -perm +111 -print0 | xargs -0 basename | head -1)
84+ else
85+ BINARY_NAME=$(find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable -print0 | xargs -0 basename | head -1)
86+ fi
87+
88+ echo "Packaging binary: $BINARY_NAME"
6489 mkdir -p release
6590 cp target/${{ matrix.target }}/release/$BINARY_NAME release/$BINARY_NAME
6691 tar -C release -czf ${{ matrix.artifact_name }}.tar.gz $BINARY_NAME
0 commit comments