Skip to content

Commit

Permalink
Add Goreleaser file (#10)
Browse files Browse the repository at this point in the history
* Bump go release version

* Add goreleaser config file
  • Loading branch information
jakeschuurmans authored Oct 15, 2024
1 parent 25930ed commit 73fadb7
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_EXPERIMENTAL: 1
GOVERSION: "1.20"
GOVERSION: "1.22"
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 73fadb7

Please sign in to comment.