Build .deb package and publish to Forgejo Releases #74
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Build .deb Package and Forgejo Release Pipeline
Summary
Build a statically-linked
streamdbinary using musl, package it as a .deb file with shell completions using nfpm, and publish to Forgejo Releases via CI/CD triggered on git tags.Target: Ubuntu 24.04 / 26.04
Files to Modify
flake.nix- Add musl build and .deb packaging.forgejo/workflows/release.yml- New release workflowImplementation
1. Add Version Reading from Cargo.toml
At the top of the
letblock in flake.nix:Then use
inherit version;in all derivations instead of hardcoding"0.1.0".2. Add musl Static Build
3. Add .deb Packaging with Shell Completions
4. Update packages Output
5. Create Release Workflow
New file
.forgejo/workflows/release.yml:Required Setup (Manual)
https://git.konstantinfickel.de/user/settings/applicationsRELEASE_TOKENin repository settingsRelease Workflow
Option A: Manual dispatch (recommended)
Cargo.tomlgit commit -am "chore: bump version to X.Y.Z"git pushOption B: Tag push
Cargo.tomlgit commit -am "chore: bump version to X.Y.Z"git tag vX.Y.Zgit push && git push --tagsVerification
Test musl build locally:
Test .deb build locally:
Test installation in Ubuntu container:
Implementation Summary
Branch:
74_deb-package-releasePR URL: https://git.konstantinfickel.de/kfickel/streamd/compare/main...74_deb-package-release
Changes Made
Version extraction from Cargo.toml (
flake.nix)version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;"0.1.0"withinherit version;Musl static build (
flake.nix)mkMuslCraneLibandmkStreamdMuslfunctionsx86_64-unknown-linux-muslwith static linking.deb packaging (
flake.nix)mkStreamdDebfunction using nfpm/usr/bin/streamdRelease workflow (
.forgejo/workflows/release.yml)v*) or manual workflow dispatchforgejo-release@v2Documentation (
README.md)Commits
41ca1fcrefactor(flake): read version from Cargo.toml73ecd4efeat(flake): add musl static build for streamd8b210a3feat(flake): add .deb packaging with shell completions08f09fbfeat(flake): expose streamd-musl and streamd-deb packagesdfd3598feat(ci): add release workflow for .deb and static binaryae539f0docs: add installation instructions for .deb, binary, and NixRequired Manual Setup
RELEASE_TOKENToken Usage
Findings
completionssubcommand was already implemented, making shell completion generation simple