ci: update the release process (WIP)#29
Conversation
Add Release Please GitHub Action with automated Go binary builds. On release, builds cross-platform binaries (darwin/linux/windows, amd64/arm64) and uploads them as release assets.
Run go test and golangci-lint on pull requests to main.
There was a problem hiding this comment.
Pull request overview
Adds GitHub Actions workflows and Release Please configuration to automate releases (versioning/changelog/GitHub Releases), build cross-platform Go binaries, and run PR checks on main.
Changes:
- Introduce Release Please config + manifest for automated tagging and releases.
- Add release workflow to build/upload multi-OS/arch Go binaries as GitHub Release assets.
- Add PR workflow to run
go test,gofmtchecks, andgolangci-lint.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
release-please-config.json |
Configures Release Please release strategy/tag format. |
.release-please-manifest.json |
Sets initial manifest version for Release Please tracking. |
.github/workflows/release.yaml |
Automates release creation and builds/uploads binaries as release assets. |
.github/workflows/pr-check.yaml |
Adds CI checks for tests, formatting, and linting on PRs to main. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Compare release_created explicitly against 'true' string - Create bin/ directory before build - Zip Windows .exe binaries to avoid security download blocks - Inject version via ldflags so binaries report correct version - Add --clobber to gh release upload for idempotent re-runs
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \ | ||
| -o "bin/${binary_name}.exe" . | ||
| zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe" | ||
| rm "bin/${binary_name}.exe" | ||
| else | ||
| go build \ | ||
| -ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \ |
There was a problem hiding this comment.
go build -ldflags "-X ...version.Version=..." will fail with the current code because internal/redyl/version.Version is declared as a const (linker -X can only set string variables). Change the version symbol to a var (e.g., defaulting to "dev") or remove the -X injection and update versioning another way.
| -ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \ | |
| -o "bin/${binary_name}.exe" . | |
| zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe" | |
| rm "bin/${binary_name}.exe" | |
| else | |
| go build \ | |
| -ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \ | |
| -o "bin/${binary_name}.exe" . | |
| zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe" | |
| rm "bin/${binary_name}.exe" | |
| else | |
| go build \ |
| -ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \ | ||
| -o "bin/${binary_name}.exe" . | ||
| zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe" | ||
| rm "bin/${binary_name}.exe" | ||
| else | ||
| go build \ | ||
| -ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \ |
There was a problem hiding this comment.
Same issue as the Windows branch: linker -X cannot set a const. With internal/redyl/version.Version currently a constant, this build command will fail; switch it to a var or stop using -X to set it.
| -ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \ | |
| -o "bin/${binary_name}.exe" . | |
| zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe" | |
| rm "bin/${binary_name}.exe" | |
| else | |
| go build \ | |
| -ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \ | |
| -o "bin/${binary_name}.exe" . | |
| zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe" | |
| rm "bin/${binary_name}.exe" | |
| else | |
| go build \ |
| - uses: googleapis/release-please-action@v4 | ||
| id: release | ||
| with: | ||
| release-type: simple |
There was a problem hiding this comment.
This workflow appears to be using Release Please "manifest" mode (new release-please-config.json + .release-please-manifest.json). In that mode, passing release-type: simple here is redundant and can be confusing (and may override/ignore package config depending on action behavior). Consider removing release-type and explicitly setting config-file/manifest-file, or drop the config/manifest files and use single-package inputs only.
| release-type: simple | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json |
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
There was a problem hiding this comment.
Workflow-level permissions grant pull-requests: write to all jobs, including build/upload steps that don't need it. To follow least-privilege, consider moving pull-requests: write to just the release-please job and scoping other jobs to contents: read (build) and contents: write (asset upload) as needed.
Summary
go testandgolangci-linton pull requests to main