fix pipeline breaks

This commit is contained in:
sreedevk
2025-07-19 12:27:49 +00:00
parent 6a24ca5ecf
commit d06fe93171
3 changed files with 39 additions and 7 deletions

View File

@@ -1,2 +0,0 @@
[build]
rustflags = ["-C", "target-feature=+aes,+sse2"]

View File

@@ -1,4 +1,4 @@
name: Deduplicator Build & Release CI Pipeline name: Deduplicator Release Build CI Pipeline
on: on:
push: push:
@@ -8,6 +8,8 @@ on:
jobs: jobs:
lint_test: lint_test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C target-feature=+aes,+sse2"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -35,15 +37,19 @@ jobs:
- target: aarch64-unknown-linux-gnu - target: aarch64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
artifact_name: linux-aarch64 artifact_name: linux-aarch64
rustflags: "-C target-feature=+aes,+neon"
- target: x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
artifact_name: linux-amd64 artifact_name: linux-amd64
rustflags: "-C target-feature=+aes,+sse2"
- target: x86_64-apple-darwin - target: x86_64-apple-darwin
os: macos-14 os: macos-14
artifact_name: macos-amd64 artifact_name: macos-amd64
rustflags: "-C target-feature=+aes,+sse2"
- target: aarch64-apple-darwin - target: aarch64-apple-darwin
os: macos-14 os: macos-14
artifact_name: macos-arm64 artifact_name: macos-arm64
rustflags: "-C target-feature=+aes,+neon"
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -55,12 +61,31 @@ jobs:
- name: Add target - name: Add target
run: rustup target add ${{ matrix.target }} run: rustup target add ${{ matrix.target }}
- name: Install cross-compilation toolchain (Linux ARM only)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Build release binary - name: Build release binary
run: cargo build --release --target ${{ matrix.target }} env:
RUSTFLAGS: ${{ matrix.rustflags }}
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: ${{ matrix.target == 'aarch64-unknown-linux-gnu' && 'aarch64-linux-gnu-gcc' || '' }}
run: |
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
fi
cargo build --release --target ${{ matrix.target }}
- name: Package binary - name: Package binary
run: | run: |
BINARY_NAME=$(basename $(find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable | head -1)) if [[ "${{ matrix.os }}" == macos* ]]; then
BINARY_NAME=$(find target/${{ matrix.target }}/release -maxdepth 1 -type f -perm +111 -print0 | xargs -0 basename | head -1)
else
BINARY_NAME=$(find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable -print0 | xargs -0 basename | head -1)
fi
echo "Packaging binary: $BINARY_NAME"
mkdir -p release mkdir -p release
cp target/${{ matrix.target }}/release/$BINARY_NAME release/$BINARY_NAME cp target/${{ matrix.target }}/release/$BINARY_NAME release/$BINARY_NAME
tar -C release -czf ${{ matrix.artifact_name }}.tar.gz $BINARY_NAME tar -C release -czf ${{ matrix.artifact_name }}.tar.gz $BINARY_NAME

View File

@@ -61,14 +61,23 @@ Currently, you can only install deduplicator using cargo package manager.
> GxHash relies on aes hardware acceleration, so please set `RUSTFLAGS` to `"-C target-feature=+aes"` or `"-C target-cpu=native"` before > GxHash relies on aes hardware acceleration, so please set `RUSTFLAGS` to `"-C target-feature=+aes"` or `"-C target-cpu=native"` before
> installing. > installing.
#### install from crates.io #### install from crates.io (stable)
```bash ```bash
$ RUSTFLAGS="-C target-cpu=native" cargo install deduplicator $ RUSTFLAGS="-C target-cpu=native" cargo install deduplicator
# or
$ RUSTFLAGS="-C target-feature=+aes,+sse2" cargo install deduplicator
``` ```
#### install from git #### install from git (nightly)
```bash ```bash
$ RUSTFLAGS="-C target-cpu=native" cargo install deduplicator --git https://github.com/sreedevk/deduplicator $ RUSTFLAGS="-C target-cpu=native" cargo install deduplicator --git https://github.com/sreedevk/deduplicator
# or
$ RUSTFLAGS="-C target-feature=+aes,+sse2" cargo install --git https://github.com/sreedevk/deduplicator
``` ```
## Performance ## Performance