Skip to content

Commit 7abfb5a

Browse files
committed
Initial release
A high-performance Rust CLI to deduplicate Relay-generated artifact files. Features: - 60-70% raw size reduction via multi-pass hierarchical extraction - Automatic relay config detection and validation - Pre-built binaries for macOS/Linux (x64/ARM64) - npm-installable via GitHub releases Replaces the TypeScript implementation with ~6x faster performance.
0 parents  commit 7abfb5a

23 files changed

+4204
-0
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Rust toolchain
19+
uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Run tests
22+
run: cargo test --all-targets
23+
24+
- name: Check formatting
25+
run: cargo fmt --check
26+
27+
- name: Clippy
28+
run: cargo clippy --all-targets -- -D warnings
29+
30+
build-check:
31+
strategy:
32+
matrix:
33+
os: [ubuntu-latest, macos-latest]
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Install Rust toolchain
39+
uses: dtolnay/rust-toolchain@stable
40+
41+
- name: Build
42+
run: cargo build --release
43+

.github/workflows/release.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
BINARY_NAME: relay-dedup
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Rust toolchain
19+
uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Run tests
22+
run: cargo test --all-targets
23+
24+
- name: Check formatting
25+
run: cargo fmt --check
26+
27+
- name: Clippy
28+
run: cargo clippy --all-targets -- -D warnings
29+
30+
build:
31+
needs: test
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
# macOS ARM64 (Apple Silicon)
37+
- target: aarch64-apple-darwin
38+
os: macos-14
39+
cross: false
40+
41+
# macOS x64 (Intel)
42+
- target: x86_64-apple-darwin
43+
os: macos-13
44+
cross: false
45+
46+
# Linux x64 (musl - static, works on any distro)
47+
- target: x86_64-unknown-linux-musl
48+
os: ubuntu-latest
49+
cross: true
50+
51+
# Linux ARM64 (musl - static, works on any distro)
52+
- target: aarch64-unknown-linux-musl
53+
os: ubuntu-latest
54+
cross: true
55+
56+
runs-on: ${{ matrix.os }}
57+
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
62+
- name: Install Rust toolchain
63+
uses: dtolnay/rust-toolchain@stable
64+
with:
65+
targets: ${{ matrix.target }}
66+
67+
- name: Install cross (for cross-compilation)
68+
if: matrix.cross
69+
run: cargo install cross --git https://github.com/cross-rs/cross
70+
71+
- name: Build (native)
72+
if: ${{ !matrix.cross }}
73+
run: cargo build --release --target ${{ matrix.target }}
74+
75+
- name: Test (native)
76+
if: ${{ !matrix.cross }}
77+
run: cargo test --release --target ${{ matrix.target }}
78+
79+
- name: Build (cross)
80+
if: matrix.cross
81+
run: cross build --release --target ${{ matrix.target }}
82+
83+
- name: Test (cross - in Docker)
84+
if: matrix.cross
85+
run: cross test --release --target ${{ matrix.target }}
86+
87+
- name: Package binary
88+
shell: bash
89+
run: |
90+
cd target/${{ matrix.target }}/release
91+
tar -czvf "../../../${{ env.BINARY_NAME }}-${{ matrix.target }}.tar.gz" ${{ env.BINARY_NAME }}
92+
93+
- name: Upload artifact
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: ${{ env.BINARY_NAME }}-${{ matrix.target }}
97+
path: ${{ env.BINARY_NAME }}-${{ matrix.target }}.tar.gz
98+
99+
release:
100+
needs: build
101+
runs-on: ubuntu-latest
102+
permissions:
103+
contents: write
104+
105+
steps:
106+
- name: Download all artifacts
107+
uses: actions/download-artifact@v4
108+
with:
109+
path: artifacts
110+
111+
- name: Create Release
112+
uses: softprops/action-gh-release@v2
113+
with:
114+
files: artifacts/**/*.tar.gz
115+
generate_release_notes: true

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated
2+
/target/
3+
/dist/
4+
5+
# Downloaded binary (fetched during npm install)
6+
/bin/relay-dedup-binary
7+
8+
# IDE
9+
.idea/
10+
.vscode/
11+
*.swp
12+
*.swo
13+
*~
14+
15+
# macOS
16+
.DS_Store
17+
18+
# Test artifacts
19+
/tests/output/
20+
/tests/output_*/
21+

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/fixtures/**

0 commit comments

Comments
 (0)