mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 07:41:27 +00:00
feat(ci): release pipeline on merge to main
After tests + image publish, a release job bumps the tag via conventional commits (github-tag-action, default_bump=false so docs/chore merges skip releasing), retags :main images in GHCR as semver+latest (tag pushes via GITHUB_TOKEN do not retrigger CI), cross-compiles the CLI for 5 platforms, and cuts a GitHub Release with generated notes and checksums. Manual v* tag pushes get the same release treatment. CLI --version now reports the tag via the previously dead -X ldflags. Authored By: TDvorak <[email protected]> Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
7c19af307e
commit
a99f2e461e
3 files changed
+104
No files matched your search
@@ -6,7 +6,15 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// Injected at build time via -ldflags (see scripts/build-cli.sh).
|
||||
var (
|
||||
Version = "dev"
|
||||
BuildTime = "unknown"
|
||||
GitCommit = "unknown"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cli.SetVersion(fmt.Sprintf("%s (%s, %s)", Version, GitCommit, BuildTime))
|
||||
if err := cli.Run(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
||||
os.Exit(1)
|
||||
|
||||
@@ -27,6 +27,12 @@ func Execute() {
|
||||
cobra.CheckErr(rootCmd.Execute())
|
||||
}
|
||||
|
||||
// SetVersion overrides the version reported by `containr --version`.
|
||||
// Called by main with the value injected via -ldflags at build time.
|
||||
func SetVersion(v string) {
|
||||
rootCmd.Version = v
|
||||
}
|
||||
|
||||
func init() {
|
||||
cobra.OnInitialize(initConfig)
|
||||
|
||||
|
||||
Reference in new issue
Block a user