Skip to content

Commit

Permalink
Add goreleaser config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeschuurmans committed Oct 15, 2024
1 parent a2c691f commit 852107b
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 852107b

Please sign in to comment.