fix pipeline breaks #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deduplicator Release Build CI Pipeline | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| lint_test: | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTFLAGS: "-C target-feature=+aes,+sse2" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Run cargo check | |
| run: cargo check | |
| - name: Run cargo clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Run tests | |
| run: cargo test -- --test-threads=1 | |
| build: | |
| needs: lint_test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| artifact_name: linux-aarch64 | |
| rustflags: "-C target-feature=+aes,+neon" | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| artifact_name: linux-amd64 | |
| rustflags: "-C target-feature=+aes,+sse2" | |
| - target: x86_64-apple-darwin | |
| os: macos-14 | |
| artifact_name: macos-amd64 | |
| rustflags: "-C target-feature=+aes,+sse2" | |
| - target: aarch64-apple-darwin | |
| os: macos-14 | |
| artifact_name: macos-arm64 | |
| rustflags: "-C target-feature=+aes,+neon" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Add target | |
| run: rustup target add ${{ matrix.target }} | |
| - name: Build release binary | |
| env: | |
| RUSTFLAGS: ${{ matrix.rustflags }} | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Package binary | |
| run: | | |
| 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 | |
| # Linux uses GNU find which supports -executable | |
| 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 | |
| cp target/${{ matrix.target }}/release/$BINARY_NAME release/$BINARY_NAME | |
| tar -C release -czf ${{ matrix.artifact_name }}.tar.gz $BINARY_NAME | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }}-binary | |
| path: ${{ matrix.artifact_name }}.tar.gz | |
| create_release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| body: "Automated release for version ${{ github.ref_name }}" | |
| files: | | |
| artifacts/*/*.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |