First off, thank you for considering contributing to rcon-cli!
To ensure a smooth developer experience and avoid "it works on my machine" issues, our local development environment is strictly aligned with our GitHub Actions Continuous Integration (CI) pipeline.
The CI pipeline runs exactly the same commands as the ones available locally via make.
- Go: Version
1.26or higher. - Docker: (Optional, but recommended) Used for building the Docker release images and running isolated tests.
- Make: Used for standardizing build and test tasks.
We use make to wrap standard Go operations. Please use these commands during development to ensure your code will pass CI:
-
make deps: Downloads and verifies Go modules.make deps
-
make test: Runs the entire test suite locally. CI requires this to pass with 0 errors.make test -
make build: Compiles therconbinary quickly for local validation.make build
-
make lint: Runsgolangci-lint(v2.10.1) across the codebase.- This is configured via
.golangci.ymland is a strict requirement in CI. - The command automatically uses
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1 runto ensure you are using the exact same version of the linter as the CI pipeline, without needing to install it manually on your system.
make lint
- This is configured via
When you push code or open a Pull Request, GitHub Actions will trigger the build.yml workflow. Here is what happens in detail:
- Environment Setup: The pipeline sets up Go
1.26. - Linting: Runs
golangci-lint-actionusing versionv2.10.1. If the linter fails, the pipeline fails. - Dependency Fetching: Runs
make deps. - Testing: Runs
make test. - Compilation: Runs
make build. - Docker Validation:
- A static analysis of the
build/docker/Dockerfileis performed usinghadolint. - A test Docker image is built using
golang:1.26-alpineas the builder. - A smoke test is run (e.g., executing
--helpinside the built Alpine container). - Trivy scans the image for
CRITICALorHIGHvulnerabilities.
- A static analysis of the
- Publishing: For PRs and branches, the image is only built for validation. When a tag (
v*) is pushed, a separateRelease Pipelinejob using GoReleaser is triggered. This job automatically cross-compiles binaries, creates archives with SHA256 checksums, builds multi-arch Docker images, pushes them to GHCR, and attaches everything to a new GitHub Release.
We use GoReleaser to automate the release process via GitHub Actions.
To create a new release:
- Update
CHANGELOG.mdwith the new changes under the appropriate version header. - Commit your changes:
git commit -am "chore: release v0.11.0" - Tag the release:
git tag v0.11.0 - Push the tag:
git push origin v0.11.0
The CI pipeline will handle the rest.
- Ensure CI passes locally: Before committing, always run:
make deps && make test && make lint && make build
- Commit your changes: Provide clear and concise commit messages.
- Open a Pull Request: Describe what you changed and why. If it fixes an open issue, reference it in the description.
If you have found a bug, please create an issue and indicate your operating system, platform, and the game on which the error was reproduced. Also, describe the exact steps you took so the error can be easily reproduced.