Skip to content

feat: add reproducible debian packaging with goreleaser & CI workflow #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MoeMahhouk
Copy link
Member

This pull request introduces comprehensive updates to the release workflow, packaging system, and reproducibility features for the project. Key changes include enhancements to the GitHub Actions workflow for releases, a new Makefile section for packaging, reproducible Debian packaging with GoReleaser, and systemd integration for the HTTP server. These changes aim to improve automation, ensure reproducible builds, and simplify deployment.

GitHub Actions Workflow Enhancements

  • Added support for manual workflow dispatch with inputs for snapshot releases in .github/workflows/release.yaml.
  • Updated the release job to include steps for running tests, lints, and reproducible builds, as well as uploading artifacts and testing package installation.

Packaging and Reproducibility

  • Introduced reproducible Debian and RPM packaging using GoReleaser, including configuration for consistent metadata, file permissions, and checksums in .goreleaser.yaml.
  • Added new Makefile targets for building, testing, and cleaning packages, as well as verifying reproducibility of builds.

Systemd Integration

  • Added a systemd service file (packaging/go-template-httpserver.service) for the HTTP server, with configuration for secure operation and logging.
  • Included a default configuration file (packaging/go-template-httpserver.default) for customizable runtime parameters.

Post-Install and Cleanup Scripts

  • Added post-install, pre-remove, and post-remove scripts for managing the HTTP server service and ensuring proper cleanup during package installation and removal. [1] [2] [3]

Documentation Updates

  • Updated README.md with instructions for reproducible Debian packaging, including prerequisites, build steps, and package contents.

@MoeMahhouk MoeMahhouk requested review from metachris and bakhtin June 18, 2025 19:56
@MoeMahhouk MoeMahhouk force-pushed the main branch 9 times, most recently from 672b6f8 to 2e06404 Compare June 18, 2025 22:45
set -e

if ! id "go-template" &>/dev/null; then
useradd --system --no-create-home --shell /bin/false go-template
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think on installation it should create users and modify the overall system by default 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is following the packaging best practices of having the binary, systemd, and the user creation which the systemd will use to execute the binary with. So part of the deb installation process.
We could remove this but it might be beneficial for the general use-case where you package your workflow and provide a installation/startup process for it

@MoeMahhouk MoeMahhouk force-pushed the main branch 2 times, most recently from d4d29df to df3c7bd Compare June 19, 2025 09:31
@MoeMahhouk MoeMahhouk marked this pull request as ready for review June 19, 2025 09:37
@@ -64,7 +64,7 @@ jobs:
run: go install mvdan.cc/[email protected]

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@2025.1.1
run: go install honnef.co/go/tools/cmd/staticcheck@v0.6.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

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.

2 participants