Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
add .goreleaser to push image (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alva8756 authored May 3, 2024
1 parent 5b32638 commit be015d3
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
project_name: component-inventory
before:
hooks:
- go mod download

builds:
-
id: go
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
ldflags:
- -s -w
- -X go.infratographer.com/x/versionx.appName={{.ProjectName}}
- -X go.infratographer.com/x/versionx.version={{.Version}}
- -X go.infratographer.com/x/versionx.commit={{.Commit}}
- -X go.infratographer.com/x/versionx.date={{.Date}}
- -X go.infratographer.com/x/versionx.builtBy=goreleaser
binary: component-inventory

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 }}"
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 be015d3

Please sign in to comment.