-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.goreleaser.yml
102 lines (91 loc) · 3.65 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
version: 2
project_name: coredhcp
before:
hooks:
- go install github.com/coredhcp/coredhcp/cmds/coredhcp-generator@latest
- coredhcp-generator -t generator/coredhcp.go.template -f generator/plugins.txt github.com/OpenCHAMI/coresmd/coresmd github.com/OpenCHAMI/coresmd/bootloop -o coredhcp/coredhcp.go
- go mod tidy
builds:
- id: coredhcp
main: ./coredhcp/
goos: # CoreDHCP only supports linux
- linux
goarch:
- amd64
- arm64
goamd64:
- v3
# If you want to build this locally, you can set the following environment variables:
# export BUILD_HOST=$(hostname)
# export GO_VERSION=$(go version | awk '{print $3}')
# export BUILD_USER=$(whoami)
ldflags:
- "-s -w \
-X github.com/OpenCHAMI/coresmd/internal/version.GitCommit={{ .Commit }} \
-X github.com/OpenCHAMI/coresmd/internal/version.BuildTime={{ .Date }} \
-X github.com/OpenCHAMI/coresmd/internal/version.Version={{ .Version }} \
-X github.com/OpenCHAMI/coresmd/internal/version.GitBranch={{ .Branch }} \
-X github.com/OpenCHAMI/coresmd/internal/version.GitTag={{ .Tag }} \
-X github.com/OpenCHAMI/coresmd/internal/version.GitState={{ .GitTreeState }} \
-X github.com/OpenCHAMI/coresmd/internal/version.BuildHost={{ .Env.BUILD_HOST }} \
-X github.com/OpenCHAMI/coresmd/internal/version.GoVersion={{ .Env.GO_VERSION }} \
-X github.com/OpenCHAMI/coresmd/internal/version.BuildUser={{ .Env.BUILD_USER }} "
binary: coredhcp
env:
# The bootloop plugin uses sqlite3 which requires CGO.
- CGO_ENABLED=1
- >-
CC={{- if eq .Os "linux" -}}
{{- if eq .Arch "amd64" -}}gcc{{- else -}}aarch64-linux-gnu-gcc{{- end -}}
{{- end }}
dockers:
- image_templates:
- &amd64_linux_image ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-amd64
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-amd64
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-amd64
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
goarch: amd64
goamd64: v3
extra_files:
- LICENSE
- README.md
- image_templates:
- &arm64v8_linux_image ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-arm64
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-arm64
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-arm64
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
extra_files:
- README.md
- LICENSE
goarch: arm64
docker_manifests:
- name_template: "ghcr.io/openchami/{{.ProjectName}}:latest"
image_templates:
- *amd64_linux_image
- *arm64v8_linux_image
- name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}"
image_templates:
- *amd64_linux_image
- *arm64v8_linux_image
- name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}"
image_templates:
- *amd64_linux_image
- *arm64v8_linux_image
- name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}"
image_templates:
- *amd64_linux_image
- *arm64v8_linux_image