Skip to content

Commit 9b2e338

Browse files
bordeuxclaude
andcommitted
ci: add DEB package generation for Debian/Ubuntu
- Add cargo-deb metadata to Cargo.toml with package configuration - Update release workflow to build .deb packages for amd64 and arm64 - DEB packages are automatically uploaded to GitHub releases 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b85f4c9 commit 9b2e338

3 files changed

Lines changed: 43 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
os: ubuntu-latest
7575
artifact_name: tmpltool
7676
asset_name: tmpltool-linux-x86_64
77+
deb_arch: amd64
7778

7879
- target: x86_64-unknown-linux-musl
7980
os: ubuntu-latest
@@ -84,6 +85,7 @@ jobs:
8485
os: ubuntu-latest
8586
artifact_name: tmpltool
8687
asset_name: tmpltool-linux-aarch64
88+
deb_arch: arm64
8789

8890
- target: x86_64-apple-darwin
8991
os: macos-latest
@@ -165,13 +167,36 @@ jobs:
165167
cd target/${{ matrix.target }}/release
166168
Compress-Archive -Path ${{ matrix.artifact_name }} -DestinationPath ../../../${{ matrix.asset_name }}.zip
167169
170+
- name: Install cargo-deb (Linux DEB)
171+
if: matrix.deb_arch != ''
172+
run: cargo install cargo-deb
173+
174+
- name: Build DEB package (x86_64)
175+
if: matrix.deb_arch == 'amd64'
176+
run: |
177+
cargo deb --no-build --target ${{ matrix.target }}
178+
cp target/${{ matrix.target }}/debian/*.deb tmpltool_${{ needs.semantic-release.outputs.new_release_version }}_${{ matrix.deb_arch }}.deb
179+
180+
- name: Build DEB package (aarch64)
181+
if: matrix.deb_arch == 'arm64'
182+
run: |
183+
cargo deb --no-build --target ${{ matrix.target }}
184+
cp target/${{ matrix.target }}/debian/*.deb tmpltool_${{ needs.semantic-release.outputs.new_release_version }}_${{ matrix.deb_arch }}.deb
185+
168186
- name: Upload artifact (Linux/macOS)
169187
if: matrix.os != 'windows-latest'
170188
uses: actions/upload-artifact@v4
171189
with:
172190
name: ${{ matrix.asset_name }}
173191
path: ${{ matrix.asset_name }}.tar.gz
174192

193+
- name: Upload DEB artifact
194+
if: matrix.deb_arch != ''
195+
uses: actions/upload-artifact@v4
196+
with:
197+
name: tmpltool-deb-${{ matrix.deb_arch }}
198+
path: tmpltool_${{ needs.semantic-release.outputs.new_release_version }}_${{ matrix.deb_arch }}.deb
199+
175200
- name: Upload artifact (Windows)
176201
if: matrix.os == 'windows-latest'
177202
uses: actions/upload-artifact@v4

Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,20 @@ urlencoding = "2"
3939

4040
[dev-dependencies]
4141
tempfile = "3.24.0"
42+
43+
[package.metadata.deb]
44+
maintainer = "Chris Bednarczyk <tmpltool@bordeux.net>"
45+
copyright = "2026, Chris Bednarczyk"
46+
license-file = ["LICENSE", "0"]
47+
extended-description = """\
48+
A fast and simple command-line template rendering tool using MiniJinja \
49+
(Jinja2-compatible) templates with environment variables. Features include \
50+
hash generation (MD5, SHA1, SHA256, SHA512), filesystem operations, \
51+
data parsing (JSON, YAML, TOML), validation functions, and more."""
52+
section = "utils"
53+
priority = "optional"
54+
assets = [
55+
["target/release/tmpltool", "usr/bin/", "755"],
56+
["README.md", "usr/share/doc/tmpltool/README.md", "644"],
57+
["LICENSE", "usr/share/doc/tmpltool/LICENSE", "644"],
58+
]

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Before implementing new functions/filters, note that MiniJinja already provides
291291

292292
- [ ] Publish to crates.io for `cargo install tmpltool`
293293
- [ ] Create Homebrew formula for macOS
294-
- [ ] Create APT/DEB package for Debian/Ubuntu
294+
- [x] Create APT/DEB package for Debian/Ubuntu
295295
- [ ] Create RPM package for Fedora/RHEL
296296
- [ ] Create Chocolatey package for Windows
297297
- [ ] Create Nix package

0 commit comments

Comments
 (0)