✨ feat: add dual release workflow for CLI and server#46
Conversation
- Add recally CLI build (./cmd/recally) - lightweight, no frontend deps - Add recally-server build (./main.go) - full app with frontend hooks - Create Dockerfile.cli for CLI Docker image - Update Dockerfile.goreleaser for server binary rename - Separate archives and Docker images for each component Docker images: - ghcr.io/recally-io/recally (CLI) - ghcr.io/recally-io/recally-server (Server)
- Fix duplicate release conflict: release.yml now only creates tag - GoReleaser handles the full release (changelog, assets, Docker) - Update deprecated actions (checkout@v3 → v4, set-output → GITHUB_OUTPUT) - Remove archived actions/create-release@v1 - Rename goreleaser workflow to 'GoReleaser Build' to avoid confusion - Fix Dockerfile healthcheck (remove shell syntax from distroless)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d29e09dce2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - cmd: go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest | ||
| - cmd: go install github.com/swaggo/swag/cmd/swag@latest | ||
| - cmd: go generate ./... | ||
| - cmd: sqlc generate | ||
| - cmd: swag init -g internal/port/httpserver/router.go -o docs/swagger |
There was a problem hiding this comment.
Avoid target-specific hooks for sqlc/swag generation
The new per-build hooks.pre run for every target (linux/darwin/windows, amd64/arm64). In GoReleaser these hooks inherit the target GOOS/GOARCH, so go install github.com/sqlc-dev/sqlc/.../.../swag/... will produce target binaries (e.g., Windows) and the subsequent sqlc generate/swag init executes them on the Linux runner, which fails with an exec-format error. This will break releases whenever non-native targets are enabled. Consider moving generation back to the global before hook or explicitly clearing GOOS/GOARCH for these commands so they always run with host binaries.
Useful? React with 👍 / 👎.
- Merge Dockerfile.cli into Dockerfile.goreleaser with multi-stage targets - Use --target=cli or --target=server to select build - Remove separate Dockerfile.cli
- Add {{ .Major }}.{{ .Minor }} tag to CLI docker image template
- Add corresponding docker manifest for multi-arch support
- Aligns CLI versioning with server for consistency
Summary
Add GoReleaser configuration for two separate builds:
recally(CLI)./cmd/recallyghcr.io/recally-io/recallyrecally-server(Server)./main.goghcr.io/recally-io/recally-serverChanges
.goreleaser.yamlwith dual build configurationDockerfile.clifor CLI Docker imageDockerfile.goreleaserfor server binary renameRelease Artifacts
recally_v*_*- CLI archives (tar.gz/zip)recally-server_v*_*- Server archives with migrations