diff --git a/.goreleaser.yml b/.goreleaser.yml index 0c7507f..eb23190 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,8 +1,28 @@ +version: 2 builds: -- dir: cmd/lagoon-linter +- id: lagoon-linter + binary: lagoon-linter + main: ./cmd/lagoon-linter ldflags: - > - -s -w -X main.date={{.Date}} -X "main.goVersion={{.Env.GOVERSION}}" - -X main.shortCommit={{.ShortCommit}} -X main.version={{.Version}} + -s -w + -X "main.commit={{.Commit}}" + -X "main.date={{.Date}}" + -X "main.projectName={{.ProjectName}}" + -X "main.version=v{{.Version}}" env: - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + +changelog: + use: github-native + +release: + extra_files: + - glob: "{{ .Env.GITHUB_SBOM_PATH }}" + name_template: "{{ .ProjectName }}.v{{ .Version }}.sbom.spdx.json" diff --git a/cmd/lagoon-linter/main.go b/cmd/lagoon-linter/main.go index a7241ee..1698d8b 100644 --- a/cmd/lagoon-linter/main.go +++ b/cmd/lagoon-linter/main.go @@ -4,7 +4,6 @@ import "github.com/alecthomas/kong" var ( date string - goVersion string shortCommit string version string ) diff --git a/cmd/lagoon-linter/version.go b/cmd/lagoon-linter/version.go index fec2119..7ede479 100644 --- a/cmd/lagoon-linter/version.go +++ b/cmd/lagoon-linter/version.go @@ -1,6 +1,9 @@ package main -import "fmt" +import ( + "fmt" + "runtime" +) // VersionCmd represents the version command. type VersionCmd struct{} @@ -8,6 +11,6 @@ type VersionCmd struct{} // Run the version command to print version information. func (cmd *VersionCmd) Run() error { fmt.Printf("lagoon-linter %v (%v) compiled with %v on %v\n", version, - shortCommit, goVersion, date) + shortCommit, runtime.Version(), date) return nil }