Skip to content

fix(ci): pass correct Debian version to cargo-deb#85

Merged
mairas merged 1 commit intomainfrom
fix/cargo-deb-version
Nov 22, 2025
Merged

fix(ci): pass correct Debian version to cargo-deb#85
mairas merged 1 commit intomainfrom
fix/cargo-deb-version

Conversation

@mairas
Copy link
Contributor

@mairas mairas commented Nov 22, 2025

Summary

Fix cargo-deb to use the correct Debian version with the calculated revision number, not the default -1.

Problem

cargo-deb defaults to -1 as the Debian revision, producing packages like halpi2-rust-daemon_5.0.0-1_arm64.deb. But the APT repository expects the calculated revision (e.g., 5.0.0-3), and the package's internal metadata must match.

Solution

  1. generate-changelog.sh: Parse --upstream and --revision args, write full Debian version to .debian-version file
  2. build-deb action: Read .debian-version and pass --deb-version flag to cargo-deb
  3. rename-packages.sh: Simplified - now looks for package with correct version directly

Flow

generate-changelog.sh --upstream 5.0.0 --revision 3
  → writes "5.0.0-3" to .debian-version

build-deb action
  → reads .debian-version
  → runs: cargo deb --deb-version=5.0.0-3
  → produces: halpi2-rust-daemon_5.0.0-3_arm64.deb

rename-packages.sh --version 5.0.0-3
  → finds halpi2-rust-daemon_5.0.0-3_arm64.deb
  → renames to halpi2-rust-daemon_5.0.0-3_arm64+trixie+hatlabs.deb

Test plan

  • CI passes - package built with correct version in metadata

🤖 Generated with Claude Code

cargo-deb defaults to -1 as the Debian revision, but we need the
calculated revision number (e.g., -3 for the third build).

Changes:
- generate-changelog.sh: Write Debian version to .debian-version file
- build-deb action: Read .debian-version and pass --deb-version to cargo-deb
- rename-packages.sh: Look for package with correct version (no more -1 hack)

This ensures the package's internal metadata matches the filename and
APT repository expectations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mairas mairas merged commit a6dce44 into main Nov 22, 2025
1 check passed
@mairas mairas deleted the fix/cargo-deb-version branch November 22, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant