ci: docker images + release pipeline with dev/release tagging - #1
Merged
Conversation
CI/CD: - ci.yml (PRs): gofmt, go vet, build both binaries, go test, build server+cli images without push, smoke-test `version` - release.yml: verify -> multi-arch (linux/amd64,arm64) build+push to GHCR with SBOM + provenance attestation; tags also cross-compile 5 platforms into archives + checksums attached to a GitHub Release - tagging: master push -> :dev and :dev-<sha>; vX.Y.Z -> X.Y.Z, X.Y, X, latest; pre-release tags get the exact version only Build: - Dockerfile: multi-stage, distroless static, nonroot, targets server + cli - Makefile: build, build-cross, docker, docker-buildx, vet, fmt-check, test - internal/version + `version` command on both binaries (ldflags injected) Fix: - .gitignore: bare `grpc-server` pattern matched the cmd/grpc-server/ dir, so the gRPC server entrypoint was never committed. Anchored to repo root.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThe change adds version metadata, a gRPC server executable, Makefile and Docker build targets, CI validation, multi-platform image publishing, release binary packaging, and related documentation. ChangesBuild and release pipeline
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant MetadataJob
participant DockerBuild
participant GHCR
participant BinaryBuild
participant ReleaseJob
GitHubActions->>MetadataJob: resolve version, commit, and build date
MetadataJob->>DockerBuild: provide build metadata
DockerBuild->>GHCR: publish server and CLI images
MetadataJob->>BinaryBuild: provide release metadata
BinaryBuild-->>ReleaseJob: upload platform artifacts
GHCR-->>ReleaseJob: provide published image details
ReleaseJob->>ReleaseJob: generate checksums and release notes
ReleaseJob-->>GitHubActions: publish GitHub Release
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI that builds both binaries and publishes multi-arch container images, with
:devon master and semver tags on releases.Tagging policy
masterdev,dev-<short-sha>v0.0.1(any0.x.y)0.0.1,0.0,latestv1.2.31.2.3,1.2,1,latestv1.2.3-rc11.2.3-rc1only0.xgets no major-only tag —docker/metadata-actionskips{{major}}for initial-development versions.Images:
ghcr.io/igun997/deploy-everything(server, entrypointgrpc-server, port 50051) andghcr.io/igun997/deploy-everything-cli. Both distroless static,nonroot,linux/amd64+linux/arm64, SBOM + provenance attestation. No secrets needed — built-inGITHUB_TOKEN.Workflows
.github/workflows/ci.yml(PRs): gofmt,go vet, build both binaries,go test, build both images without push,versionsmoke test.github/workflows/release.yml:verify → meta → images → binaries → release. Nothing publishes unless vet/build/test pass. Tag pushes also cross-compile linux/darwin (amd64+arm64) and windows/amd64 intotar.gz/zip+checksums.txtattached to a GitHub ReleaseAlso included
Dockerfile: one file, two final stages (server,cli), Go cross-compile from$BUILDPLATFORMso arm64 needs no QEMU emulationMakefile:build,build-cross,test,vet,fmt-check,docker,docker-cli,docker-buildx PUSH=1— same ldflags as CIinternal/version+versioncommand on both binaries (Version/Commit/Datevia-ldflags).gitignorehad a baregrpc-serverpattern that matched thecmd/grpc-server/directory, so the gRPC server entrypoint was never committed. Anchored the build-output patterns to repo root;cmd/grpc-server/main.gois now tracked. Without this, CI could not build the server.Tested locally
gofmt -l .clean,go vet ./...cleanmake build→ both binaries,versionprints injected metadatadocker buildboth targets: server 20.9 MB, cli 8.74 MB;docker run --rm <img> versionworksdocker buildx build --platform linux/amd64,linux/arm64succeeds for the server targetgo test ./...with no.envpresent → integration tests skip, suite passes (matches CI environment)Note: with a live
.envlocally,TestComposeFullStackfails onservices.compose.updateSourceInlinereturning400 ... "zodErrors":{"content":"Required"}. Pre-existing panel API mismatch, unrelated to this PR; it skips in CI.Summary by CodeRabbit
New Features
versioncommand displaying version, commit, build date, and runtime details.Release & Distribution
Documentation