-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
117 lines (104 loc) · 3.76 KB
/
.goreleaser.yaml
File metadata and controls
117 lines (104 loc) · 3.76 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
version: 2
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
ldflags:
- -s -w
- -X 'github.com/defenseunicorns/uds-cli/src/config.CLIVersion={{.Tag}}'
- -X 'github.com/zarf-dev/zarf/src/config.ActionsCommandZarfPrefix=zarf'
- -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 'github.com/derailed/k9s/cmd.version={{.Env.K9S_VERSION}}'
- -X 'github.com/google/go-containerregistry/cmd/crane/cmd.Version={{.Env.CRANE_VERSION}}'
- -X 'github.com/zarf-dev/zarf/src/cmd.syftVersion={{.Env.SYFT_VERSION}}'
- -X 'github.com/zarf-dev/zarf/src/cmd.archivesVersion={{.Env.ARCHIVES_VERSION}}'
- -X 'helm.sh/helm/v4/internal/version.version={{.Env.HELM_VERSION}}'
goarch:
- amd64
- arm64
binary: uds
# Save the built artifacts as binaries (instead of wrapping them in a tarball)
archives:
- formats: binary
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{- title .Os }}_{{ .Arch }}"
# generate a sha256 checksum of all release artifacts
checksum:
name_template: "checksums.txt"
algorithm: sha256
# generate sboms for each binary artifact
sboms:
- artifacts: binary
documents:
- "sbom_{{ .ProjectName }}_{{ .Tag }}_{{- title .Os }}_{{ .Arch }}.sbom"
snapshot:
version_template: "{{ incpatch .Version }}-snapshot"
# Use the auto-generated changelog github provides
changelog:
use: github-native
brews:
- name: uds
repository:
owner: defenseunicorns
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
branch: "{{ .ProjectName }}-{{ .Tag }}"
pull_request:
enabled: true
base:
branch: main
owner: defenseunicorns
name: homebrew-tap
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://github.com/defenseunicorns/uds-cli"
description: "CLI for Unicorn Delivery Service"
# 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: "uds@{{ .Version }}"
repository:
owner: defenseunicorns
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
branch: "{{ .ProjectName }}-{{ .Tag }}"
pull_request:
enabled: true
base:
branch: main
owner: defenseunicorns
name: homebrew-tap
commit_msg_template: "Brew formula update for {{ .ProjectName }} versioned release {{ .Tag }}"
homepage: "https://github.com/defenseunicorns/uds-cli"
description: "CLI for Unicorn Delivery Service"
# Generate a GitHub release and publish the release for the tag
release:
github:
owner: defenseunicorns
name: uds-cli
prerelease: auto
mode: append
draft: false
git:
# What should be used to sort tags when gathering the current and previous
# tags if there are more than one tag in the same commit.
#
# Default: '-version:refname'.
tag_sort: -version:creatordate
# Tags to be ignored by GoReleaser.
# This means that GoReleaser will not pick up tags that match any of the
# provided values as either previous or current tags.
#
# Templates: allowed.
ignore_tags:
- nightly-unstable