Skip to content

Commit 1474741

Browse files
committed
chore: add packaging metadata and fix release asset collisions
- Added cargo-deb and cargo-generate-rpm to workflow - Implemented unique naming for platform-specific binaries - Updated maintainer info in Cargo.toml - Fixed artifact paths in release step
1 parent 2c5251f commit 1474741

2 files changed

Lines changed: 63 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ jobs:
1919
include:
2020
- os: ubuntu-latest
2121
target: x86_64-unknown-linux-gnu
22-
artifact_name: image-diff-linux
22+
artifact_name: linux
2323
- os: macos-latest
2424
target: x86_64-apple-darwin
25-
artifact_name: image-diff-macos
25+
artifact_name: macos
2626
- os: windows-latest
2727
target: x86_64-pc-windows-msvc
28-
artifact_name: image-diff-windows.exe
28+
artifact_name: windows
2929

3030
steps:
3131
- uses: actions/checkout@v4
32-
32+
3333
- name: Install Rust
3434
uses: dtolnay/rust-toolchain@stable
3535
with:
@@ -38,16 +38,39 @@ jobs:
3838
- name: Build Binary
3939
run: cargo build --release --target ${{ matrix.target }}
4040

41-
- name: Upload Artifact
41+
- name: Package Linux (DEB & RPM)
42+
if: matrix.os == 'ubuntu-latest'
43+
run: |
44+
cargo install cargo-deb cargo-generate-rpm
45+
cargo deb --target ${{ matrix.target }} --no-build
46+
cargo generate-rpm --target ${{ matrix.target }}
47+
cp target/${{ matrix.target }}/debian/*.deb image-diff.deb
48+
cp target/${{ matrix.target }}/generate-rpm/*.rpm image-diff.rpm
49+
50+
- name: Prepare Windows
51+
if: matrix.os == 'windows-latest'
52+
run: cp target/${{ matrix.target }}/release/image-diff.exe image-diff-windows.exe
53+
54+
- name: Prepare macOS
55+
if: matrix.os == 'macos-latest'
56+
run: cp target/${{ matrix.target }}/release/image-diff image-diff-macos
57+
58+
- name: Prepare Linux Binary
59+
if: matrix.os == 'ubuntu-latest'
60+
run: cp target/${{ matrix.target }}/release/image-diff image-diff-linux
61+
62+
- name: Upload Artifacts
4263
uses: actions/upload-artifact@v4
4364
with:
44-
name: ${{ matrix.artifact_name }}
65+
name: ${{ matrix.artifact_name }}-artifacts
4566
path: |
46-
target/${{ matrix.target }}/release/image-diff
47-
target/${{ matrix.target }}/release/image-diff.exe
67+
image-diff.deb
68+
image-diff.rpm
69+
image-diff-linux
70+
image-diff-windows.exe
71+
image-diff-macos
4872
if-no-files-found: ignore
4973

50-
# Optional: Automatic GitHub Release on Tags
5174
release:
5275
name: Create GitHub Release
5376
if: startsWith(github.ref, 'refs/tags/')
@@ -58,13 +81,17 @@ jobs:
5881
steps:
5982
- name: Download all artifacts
6083
uses: actions/download-artifact@v4
61-
84+
with:
85+
path: artifacts
86+
6287
- name: Create Release
6388
uses: softprops/action-gh-release@v1
6489
with:
6590
files: |
66-
image-diff-linux/image-diff
67-
image-diff-macos/image-diff
68-
image-diff-windows.exe/image-diff.exe
91+
artifacts/linux-artifacts/image-diff.deb
92+
artifacts/linux-artifacts/image-diff.rpm
93+
artifacts/linux-artifacts/image-diff-linux
94+
artifacts/windows-artifacts/image-diff-windows.exe
95+
artifacts/macos-artifacts/image-diff-macos
6996
env:
7097
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,28 @@ viuer = "0.11.0"
2323
delta_e = "0.2.1"
2424
lab = "0.7.2" # Matches delta_e dependency
2525

26+
[package.metadata.deb]
27+
maintainer = "Aftaab Siddiqui <[email protected]>"
28+
copyright = "2026, Aftaab Siddiqui"
29+
license-file = ["LICENSE", "0"]
30+
extended-description = """
31+
A high-performance CLI tool for visual image comparison with SSIM,
32+
CIEDE2000, and terminal previews.
33+
"""
34+
section = "utility"
35+
priority = "optional"
36+
assets = [
37+
["target/release/image-diff", "/usr/bin/image-diff", "755"],
38+
]
39+
40+
[package.metadata.rpm]
41+
package = "image-diff"
42+
43+
[package.metadata.rpm.cargo]
44+
buildflags = ["--release"]
45+
46+
[package.metadata.rpm.targets]
47+
image-diff = { path = "/usr/bin/image-diff" }
48+
2649
[dev-dependencies]
2750
tempfile = "3.10.1"

0 commit comments

Comments
 (0)