This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.goreleaser.yml
119 lines (110 loc) · 3.76 KB
/
.goreleaser.yml
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
118
119
# Copyright 2023 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
project_name: cluster-api-runtime-extensions-nutanix
changelog:
use: github
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
filters:
exclude:
- '^docs:'
- '^chore:'
- '^build:'
release:
footer: |
### Summary
**Full Changelog**: https://github.com/d2iq-labs/{{.ProjectName}}/compare/{{ .PreviousTag }}...{{ .Tag }}
extra_files:
- glob: ./examples/capi-quick-start/*.yaml
- glob: metadata.yaml
- glob: runtime-extension-components.yaml
before:
hooks:
- |
sh -ec 'cat <<EOF > runtime-extension-components.yaml
apiVersion: v1
kind: Namespace
metadata:
name: {{.ProjectName}}-system
$(helm template {{.ProjectName}} ./charts/{{.ProjectName}} \
--namespace {{.ProjectName}}-system \
--set-string image.tag={{ .Version }} \
{{ if .IsSnapshot }}--set-string image.repository=ko.local/{{ .ProjectName }}{{ end }} \
)
EOF'
- sed -i 's/\${/$${/g' runtime-extension-components.yaml
builds:
- id: cluster-api-runtime-extensions-nutanix
dir: ./cmd
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s
- -w
- -X 'k8s.io/component-base/version.buildDate={{ .CommitDate }}'
- -X 'k8s.io/component-base/version.gitCommit={{ .FullCommit }}'
- -X 'k8s.io/component-base/version.gitTreeState={{ .Env.GIT_TREE_STATE }}'
- -X 'k8s.io/component-base/version.gitVersion=v{{ trimprefix .Version "v" }}'
- -X 'k8s.io/component-base/version.major={{ .Major }}'
- -X 'k8s.io/component-base/version.minor={{ .Minor }}'
- -X 'k8s.io/component-base/version/verflag.programName={{ .ProjectName }}'
goos:
- linux
goarch:
- amd64
- arm64
mod_timestamp: '{{ .CommitTimestamp }}'
hooks:
post:
- |
sh -ec 'if [ {{ .IsSnapshot }} == true ] && [ {{ .Runtime.Goarch }} == {{ .Arch }} ]; then
env GOOS=linux GOARCH={{ .Arch }} \
SOURCE_DATE_EPOCH=$(date +%s) \
KO_DOCKER_REPO=ko.local/{{ .ProjectName }} \
ko build \
--bare \
-t {{ .Version }} \
./cmd
fi'
archives:
- name_template: '{{ .ProjectName }}_v{{trimprefix .Version "v"}}_{{ .Os }}_{{ .Arch }}'
rlcp: true
builds:
- cluster-api-runtime-extensions-nutanix
kos:
- id: cluster-api-runtime-extensions-nutanix
build: cluster-api-runtime-extensions-nutanix
ldflags:
- -s
- -w
- -X 'k8s.io/component-base/version.buildDate={{ .CommitDate }}'
- -X 'k8s.io/component-base/version.gitCommit={{ .FullCommit }}'
- -X 'k8s.io/component-base/version.gitTreeState={{ .Env.GIT_TREE_STATE }}'
- -X 'k8s.io/component-base/version.gitVersion=v{{ trimprefix .Version "v" }}'
- -X 'k8s.io/component-base/version.major={{ .Major }}'
- -X 'k8s.io/component-base/version.minor={{ .Minor }}'
- -X 'k8s.io/component-base/version/verflag.programName={{ .ProjectName }}'
labels:
org.opencontainers.image.created: "{{ .CommitDate }}"
org.opencontainers.image.title: "{{ .ProjectName }}"
org.opencontainers.image.revision: "{{ .FullCommit }}"
org.opencontainers.image.version: v{{trimprefix .Version "v"}}
org.opencontainers.image.source: "{{ .GitURL }}"
platforms:
- linux/amd64
- linux/arm64
repository: ghcr.io/d2iq-labs/cluster-api-runtime-extensions-nutanix
bare: true
tags:
- v{{trimprefix .Version "v"}}
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incminor .Tag }}-dev"