From 852107b353c1f24565f2b8f876f9ceaeb0c79baf Mon Sep 17 00:00:00 2001 From: Jake Schuurmans Date: Tue, 15 Oct 2024 12:34:09 -0400 Subject: [PATCH] Add goreleaser config file --- .goreleaser.yaml | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .goreleaser.yaml diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..3e957a9 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,86 @@ +project_name: bioscfg +before: + hooks: + - go mod tidy + +builds: + - id: go + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + ldflags: + - -X "github.com/metal-toolbox/bioscfg/internal/version.AppVersion={{ .Version }}" + -X "github.com/metal-toolbox/bioscfg/internal/version.GoVersion={{ .Env.GOVERSION }}" + -X "github.com/metal-toolbox/bioscfg/internal/version.GitCommit={{ .Commit }}" + -X "github.com/metal-toolbox/bioscfg/internal/version.GitBranch={{ .Branch }}" + -X "github.com/metal-toolbox/bioscfg/internal/version.BuildDate={{ .Date }}" + +archives: + - id: go + format: tar.gz + name_template: >- + {{ .ProjectName }}_ + {{ .Version }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}64bit + {{- else if eq .Arch "386" }}32bit + {{- else if eq .Arch "arm" }}ARM + {{- else if eq .Arch "arm64" }}ARM64 + {{- else }}{{ .Arch }}{{ end }} + files: + - README.md + +checksum: + name_template: "checksums.txt" + +snapshot: + name_template: "{{ .Tag }}-next" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + +dockers: + - image_templates: + - "ghcr.io/metal-toolbox/{{.ProjectName}}:{{ .Tag }}" + - "ghcr.io/metal-toolbox/{{.ProjectName}}:latest" + dockerfile: Dockerfile + build_flag_templates: + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + +sboms: + - artifacts: archive + - id: source + artifacts: source + +signs: + - cmd: cosign + signature: "${artifact}.sig" + certificate: "${artifact}.pem" + args: + - "sign-blob" + - "--oidc-issuer=https://token.actions.githubusercontent.com" + - "--output-certificate=${certificate}" + - "--output-signature=${signature}" + - "${artifact}" + - "--yes" # required on cosign 2.0.0+ + artifacts: all + output: true + +docker_signs: + - cmd: cosign + args: + - "sign" + - "--oidc-issuer=https://token.actions.githubusercontent.com" + - "${artifact}" + - "--yes" # required on cosign 2.0.0+ + artifacts: all + output: true