-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.goreleaser.yaml
172 lines (165 loc) · 4.8 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
project_name: otel-add-on
env:
- IMAGE_TAG={{ if index .Env "IMAGE_TAG" }}{{ .Env.IMAGE_TAG }}{{ else }}{{ .Tag }}{{ end }}
- GH_REPO_ORG={{ if index .Env "GH_REPO_ORG" }}{{ .Env.GH_REPO_ORG }}{{ else }}kedify{{ end }}
builds:
- &BASE_BUILD
skip: true
id: base
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
ldflags: &ldflags
- -X github.com/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}/build.gitCommit={{ .Commit }} -X github.com/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}/build.version={{ .Env.IMAGE_TAG }}
- &HARDENED_BUILD
<<: *BASE_BUILD
id: hardened
env:
- CGO_ENABLED=1
- GOEXPERIMENT=boringcrypto
- BUILD_EXTRA_GO_LDFLAGS="-linkmode=external -extldflags=-static"
goarch:
- amd64
- &HARDENED_BUILD_ARM
<<: *BASE_BUILD
id: hardened-arm
env:
- CC=aarch64-linux-gnu-gcc
- CGO_ENABLED=1
- GOEXPERIMENT=boringcrypto
- BUILD_EXTRA_GO_LDFLAGS="-linkmode=external -extldflags=-static"
goarch:
- arm64
- <<: *BASE_BUILD
skip: false
id: otel-add-on
binary: bin/otel-add-on
main: main.go
- <<: *HARDENED_BUILD
skip: false
id: otel-add-on-hardened-amd64
main: main.go
binary: bin/otel-add-on
- <<: *HARDENED_BUILD_ARM
skip: false
id: otel-add-on-hardened-arm64
main: main.go
binary: bin/otel-add-on
release:
draft: true
prerelease: auto
changelog:
skip: true
dockers:
- &BASE_IMG
skip_push: true
id: base
use: buildx
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- &LABEL1
"--label=org.opencontainers.image.created={{.Date}}"
- &LABEL2
"--label=org.opencontainers.image.title={{.ProjectName}}"
- &LABEL3
"--label=org.opencontainers.image.revision={{.FullCommit}}"
- &LABEL4
"--label=org.opencontainers.image.version={{.Version}}"
- &LABEL5
"--label=org.opencontainers.image.description={{.ProjectName}} by Kedify"
- &BASE_IMG_ARM
<<: *BASE_IMG
id: base-arm
goarch: arm64
build_flag_templates:
- "--platform=linux/arm64"
- *LABEL1
- *LABEL2
- *LABEL3
- *LABEL4
- *LABEL5
- &HARDENED_IMG
<<: *BASE_IMG
id: hardened
build_flag_templates:
- "--build-arg=BASE_IMAGE=cgr.dev/chainguard/glibc-dynamic:latest"
- "--platform=linux/amd64"
- *LABEL1
- *LABEL2
- *LABEL3
- *LABEL4
- *LABEL5
- &HARDENED_IMG_ARM
<<: *BASE_IMG_ARM
id: hardened-arm
build_flag_templates:
- "--build-arg=BASE_IMAGE=cgr.dev/chainguard/glibc-dynamic:latest"
- "--platform=linux/arm64"
- *LABEL1
- *LABEL2
- *LABEL3
- *LABEL4
- *LABEL5
- <<: *BASE_IMG
id: otel-add-on
ids: [otel-add-on]
image_templates:
- "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64"
dockerfile: "Dockerfile.goreleaser"
skip_push: false
- <<: *BASE_IMG_ARM
id: otel-add-on-arm64
ids: [otel-add-on]
image_templates:
- "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64"
dockerfile: "Dockerfile.goreleaser"
skip_push: false
- <<: *HARDENED_IMG
id: otel-add-on-amd64-hardened
ids: [otel-add-on-hardened-amd64]
image_templates:
- "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64-hardened"
dockerfile: "Dockerfile.goreleaser"
skip_push: false
- <<: *HARDENED_IMG_ARM
id: otel-add-on-arm64-hardened
ids: [otel-add-on-hardened-arm64]
image_templates:
- "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64-hardened"
dockerfile: "Dockerfile.goreleaser"
skip_push: false
docker_manifests:
- name_template: "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-hardened"
image_templates:
- "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64-hardened"
- "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64-hardened"
- name_template: "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}"
image_templates:
- "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64"
- "ghcr.io/{{ .Env.GH_REPO_ORG }}/{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64"
docker_signs:
- id: kedify
cmd: cosign
args:
- "sign"
- "${artifact}@${digest}"
- "--yes"
artifacts: images
output: true
archives:
- format: binary
id: regular
builds:
- otel-add-on
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"
- format: binary
id: hardened
builds:
- otel-add-on-hardened-amd64
- otel-add-on-hardened-arm64
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}_hardened"