Skip to content

chore: Modernize CI pipeline, update dependencies, and fortify build process#62

Open
dmirtillo wants to merge 27 commits intogorcon:masterfrom
dmirtillo:master
Open

chore: Modernize CI pipeline, update dependencies, and fortify build process#62
dmirtillo wants to merge 27 commits intogorcon:masterfrom
dmirtillo:master

Conversation

@dmirtillo
Copy link

@dmirtillo dmirtillo commented Feb 28, 2026

Description

Hello! 👋

I've been using rcon-cli and noticed a few areas in the build, distribution, and CI/CD pipeline that could be modernized to improve developer experience, increase build speed, and fortify the security of the released Docker images.

This PR bundles those improvements into a cohesive update that aligns local development with a robust, automated CI pipeline, culminating in a fully automated, multi-platform release process powered by GoReleaser.

🛠 What changed

1. Automated Release Pipeline (GoReleaser)

  • Replaced the manual scripts/local/compile.sh bash script with an industry-standard .goreleaser.yaml configuration.
  • The CI pipeline now automatically handles cross-compiling binaries (Linux, Windows, macOS across amd64, 386, and arm64), generating tar.gz/zip archives, and computing SHA256 checksums whenever a new v* git tag is pushed.
  • Automatically generates and publishes rich GitHub Releases with changelog notes.

2. Fortified Multi-Arch Docker Pipeline & GHCR Migration

  • Migrated the Docker image registry target from Docker Hub to GitHub Container Registry (ghcr.io).
  • Multi-Arch Support: GoReleaser is configured via dockers_v2 (using docker buildx and QEMU) to natively build and publish multi-arch Docker images (linux/amd64 and linux/arm64).
  • Validation Steps: The CI pipeline now explicitly validates the Docker image before pushing:
    • hadolint to statically analyze the Dockerfile.
    • A local verification build (load: true).
    • A runtime smoke test (docker run /rcon --help) to ensure the binary boots correctly in the Alpine runner.
    • A trivy security scan to check for CRITICAL or HIGH vulnerabilities.
  • Base Image Security: Updated the Dockerfile base image to Alpine 3.23 and added apk upgrade during the build to automatically patch critical OS-level vulnerabilities (e.g., CVE-2026-22184 in zlib).

3. CI Pipeline Refactoring (GitHub Actions)

  • Parallelization: Split the monolithic build job in build.yml into distinct, granular jobs (lint, test, and build). This allows linting and testing to run concurrently, speeding up the feedback loop.
  • Fail-Fast Releases: The release job now explicitly needs: [lint, test, build, docker-ci]. Previously, it ran independently, meaning a broken commit could theoretically still trigger a published Docker image.
  • Local Alignment: Added deps, test, build, and lint targets to the Makefile so developers can run the exact same checks locally that run in CI. Added a CONTRIBUTING.md guide to document this workflow.

4. Go Toolchain & Dependency Modernization

  • Bumped the Go version uniformly to 1.26 across go.mod and .github/workflows/build.yml.
  • Upgraded the linter to golangci-lint v2.10.1 and configured the GitHub Action (golangci-lint-action@v9) to use install-mode: go-install to ensure strict compatibility with Go 1.26. Cleaned up deprecated linter rules and fixed discovered issues.
  • Added a .github/dependabot.yml configuration to automatically track and update Go modules, GitHub Actions, and Docker base images weekly.

🧪 How it was tested

  • All tests pass locally via make test.
  • The golangci-lint passes cleanly without warnings via make lint.
  • The GitHub Actions pipeline was tested end-to-end via a pre-release tag (v0.11.0). It correctly ran jobs in parallel, validated the Docker image, published the multi-arch images to GHCR, and created the GitHub Release with the cross-compiled binaries.

Let me know if you'd like any adjustments to the approach or if you'd prefer me to split any of these changes into separate PRs. Thank you for the great project!

dmirtillo and others added 27 commits February 28, 2026 00:59
This commit introduces automated dependency updates via Dependabot
and adds validation steps to the Docker build workflow to prevent
broken or vulnerable images from being pushed.

Changes include:
- Add Dependabot configuration for Go modules, GitHub Actions, and Docker.
- Update Docker base image to Go 1.21 to align with go.mod.
- Add Dockerfile linting (hadolint) to CI.
- Add a runtime smoke test (`docker run --help`) to CI.
- Add vulnerability scanning (Trivy) to CI.
- Add OpenSpec specifications and configurations.
This commit updates the CI pipeline and local build scripts to use
GitHub Container Registry (ghcr.io) instead of Docker Hub.

Key changes:
- Update build.yml to authenticate via GITHUB_TOKEN for GHCR.
- Add packages: write permissions to the Docker release job.
- Update image tags to ghcr.io/dmirtillo/rcon-cli in workflow and Makefile.
- Update Docker CI validation specifications to include GHCR scenario.
- Archive the switch-to-ghcr change artifacts.
This commit aligns local Make targets with the GitHub Actions pipeline
and modernizes the Go runtime to 1.26.

Key changes:
- Bump Go version to 1.26 across go.mod, Dockerfile, and GitHub Actions.
- Add local Makefile targets (deps, test, build) matching CI steps.
- Upgrade golangci-lint to v2.10.1 locally and in GitHub Actions (v9).
- Clean up deprecated linters and fix resulting errcheck warnings.
- Update upstream Go dependencies.
- Add CONTRIBUTING.md to document the standardized build and CI process.
- Archive build-alignment OpenSpec change.
This commit splits the monolithic 'build' job in GitHub Actions into
standalone 'lint', 'test', and 'build' jobs that run in parallel. It
also ensures that the 'docker-release' job only executes after all
upstream Go CI jobs have passed.

Key changes:
- Split monolithic 'build' job into 'lint', 'test', and 'build' in build.yml.
- Enable parallel execution for independent CI tasks.
- Add 'needs: [lint, test, build]' to the 'docker-release' job.
- Update Docker CI validation specifications to reflect the new dependency.
- Archive the 'refactor-ci-pipeline' OpenSpec change.
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