Skip to content

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

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

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

Conversation

@dmirtillo
Copy link

Description

Hello! 👋

I've been using rcon-cli and noticed a few areas in the build 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.

🛠 What changed

1. Automated Dependency Updates (Dependabot)

  • Added a .github/dependabot.yml configuration to automatically track and update Go modules, GitHub Actions, and Docker base images weekly.
  • Configured Dependabot to group updates together (to reduce PR noise) and explicitly ignore major/minor Go compiler bumps so the toolchain remains stable and manually controlled.

2. Go Toolchain & Dependency Modernization

  • Bumped the Go version uniformly to 1.26 across go.mod, .github/workflows/build.yml, and build/docker/Dockerfile.
  • Updated all upstream Go dependencies to their latest versions.
  • Upgraded the linter to golangci-lint v2.10.1 (using the new v2 YAML configuration schema) and cleaned up deprecated linter rules and fixed discovered issues.

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 Docker Releases: The docker-release job now explicitly needs: [lint, test, build]. 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. Fortified Docker Pipeline & GHCR Migration

  • Migrated the Docker image registry target from Docker Hub to GitHub Container Registry (ghcr.io).
  • Validation Steps: Before pushing any image, the CI pipeline now performs:
    • 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.
    • The image is only pushed if all the above validation steps succeed.

🧪 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 and correctly runs jobs in parallel, validates the Docker image, and publishes successfully to GHCR.

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 12 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