forked from zarf-dev/zarf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yaml
94 lines (83 loc) · 3.16 KB
/
.goreleaser.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
before:
hooks:
- go mod tidy
# Build a universal macOS binary
universal_binaries:
- replace: false
# Build the different combination of goos/arch binaries
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
ldflags:
- -s -w -X github.com/defenseunicorns/zarf/src/config.CLIVersion={{.Tag}}
- -X k8s.io/component-base/version.gitVersion=v{{.Env.K8S_MODULES_MAJOR_VER}}.{{.Env.K8S_MODULES_MINOR_VER}}.{{.Env.K8S_MODULES_PATCH_VER}}
- -X k8s.io/component-base/version.gitCommit={{.FullCommit}}
- -X k8s.io/component-base/version.buildDate={{.Date}}
- -X helm.sh/helm/v3/pkg/lint/rules.k8sVersionMajor={{.Env.K8S_MODULES_MAJOR_VER}}
- -X helm.sh/helm/v3/pkg/lint/rules.k8sVersionMinor={{.Env.K8S_MODULES_MINOR_VER}}
- -X helm.sh/helm/v3/pkg/chartutil.k8sVersionMajor={{.Env.K8S_MODULES_MAJOR_VER}}
- -X helm.sh/helm/v3/pkg/chartutil.k8sVersionMinor={{.Env.K8S_MODULES_MINOR_VER}}
goarch:
- amd64
- arm64
# Save the built artifacts as binaries (instead of wrapping them in a tarball)
archives:
- format: binary
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{- title .Os }}_{{ .Arch }}"
# generate a sha256 checksum of all release artifacts
# NOTE: We are explicitly adding the init-packages that are built prior to GoReleaser stage in the GitHub Actions workflow
checksum:
name_template: "checksums.txt"
extra_files:
- glob: ./build/zarf-init-*
algorithm: sha256
# generate sboms for each binary artifact
sboms:
- artifacts: binary
documents:
- "sbom_{{ .ProjectName }}_{{ .Tag }}_{{- title .Os }}_{{ .Arch }}.sbom"
snapshot:
name_template: "{{ incpatch .Version }}-snapshot"
# Use the auto-generated changlog github provides
changelog:
use: github-native
# Generate a GitHub release and publish the release for the tag
# NOTE: We are explicitly adding the init-packages that are built prior to GoReleaser stage in the GitHub Actions workflow
release:
github:
owner: defenseunicorns
name: zarf
prerelease: auto
mode: append
extra_files:
- glob: ./build/zarf-init-*
# Update the 'generic' brew formula and create a versioned brew formula for artifacts from this release
brews:
- name: "{{ .Env.BREW_NAME }}"
tap:
owner: defenseunicorns
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://zarf.dev/"
description: "DevSecOps for Air Gap"
# NOTE: We are using .Version instead of .Tag because homebrew has weird semver parsing rules and won't be able to
# install versioned releases that has a `v` character before the version number.
- name: "zarf@{{ .Version }}"
tap:
owner: defenseunicorns
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
commit_msg_template: "Brew formula update for {{ .ProjectName }} versioned release {{ .Tag }}"
homepage: "https://zarf.dev/"
description: "DevSecOps for Air Gap"
# Upload artifact backups to s3
blobs:
- provider: s3
region: us-gov-west-1
bucket: zarf-public
folder: "release/{{.Version}}"