Skip to content

Instantly share code, notes, and snippets.

@dirien
Created February 20, 2022 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dirien/581ed4c6f118387bb128bd002d614b93 to your computer and use it in GitHub Desktop.
Save dirien/581ed4c6f118387bb128bd002d614b93 to your computer and use it in GitHub Desktop.
Azure DevOps and GoReleaser - II
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goarch:
- amd64
- arm64
goos:
- linux
- darwin
project_name: goreleaser-ado
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
source:
enabled: true
release:
disable: true
sboms:
- artifacts: archive
- id: source
artifacts: source
signs:
- cmd: cosign
certificate: '${artifact}.pem'
args:
- sign-blob
- '-key=cosign.key'
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
artifacts: checksum
output: true
stdin: '{{ .Env.COSIGN_PASSWORD }}'
docker_signs:
- cmd: cosign
artifacts: images
output: true
args:
- 'sign'
- '-key=cosign.key'
- '${artifact}'
stdin: '{{ .Env.COSIGN_PASSWORD }}'
dockers:
- image_templates: [ "dirien/{{ .ProjectName }}:{{ .Version }}-amd64" ]
goarch: amd64
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- --platform=linux/amd64
- image_templates: [ "dirien/{{ .ProjectName }}:{{ .Version }}-arm64" ]
goarch: arm64
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- --platform=linux/arm64/v8
docker_manifests:
- name_template: 'dirien/{{ .ProjectName }}:{{ .Version }}'
image_templates:
- 'dirien/{{ .ProjectName }}:{{ .Version }}-amd64'
- 'dirien/{{ .ProjectName }}:{{ .Version }}-arm64'
- name_template: 'dirien/{{ .ProjectName }}:latest'
image_templates:
- 'dirien/{{ .ProjectName }}:{{ .Version }}-amd64'
- 'dirien/{{ .ProjectName }}:{{ .Version }}-arm64'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment