@@ -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 }}
0 commit comments