Skip to content

Commit bf30618

Browse files
committed
build: updated goreleaser file
Signed-off-by: David Allen <davidallendj@gmail.com>
1 parent b303253 commit bf30618

1 file changed

Lines changed: 97 additions & 12 deletions

File tree

.goreleaser.yaml

Lines changed: 97 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,94 @@
1+
version: 2.4
2+
project_name: opaal
13
before:
24
hooks:
35
- go mod download
6+
- go mod tidy
47
builds:
5-
- env:
6-
- CGO_ENABLED=1
8+
- id: opaal
9+
binary: opaal
10+
env:
11+
- CGO_ENABLED=0
712
goos:
813
- linux
14+
- darwin
15+
- windows
916
goarch:
1017
- amd64
18+
- arm64
19+
goamd64:
20+
- v3
21+
ldflags:
22+
- "-s -w -X main.GitCommit={{.Commit}} \
23+
-X main.BuildTime={{.Timestamp}} \
24+
-X main.Version={{.Version}} \
25+
-X main.GitBranch={{.Branch}} \
26+
-X main.GitTag={{.Tag}} \
27+
-X main.GitState={{ .Env.GIT_STATE }} \
28+
-X main.BuildHost={{ .Env.BUILD_HOST }} \
29+
-X main.GoVersion={{ .Env.GO_VERSION }} \
30+
-X main.BuildUser={{ .Env.BUILD_USER }} "
1131
dockers:
1232
- image_templates:
13-
- ghcr.io/openchami/{{.ProjectName}}:latest
14-
- ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}
15-
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}
16-
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}
33+
- &amd64_linux_image ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-amd64
34+
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-amd64
35+
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-amd64
36+
# - ghcr.io/openchami/{{.ProjectName}}:latest
37+
# - ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}
38+
# - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}
39+
# - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}
40+
use: buildx
1741
build_flag_templates:
1842
- "--pull"
43+
- "--platform=linux/amd64"
1944
- "--label=org.opencontainers.image.created={{.Date}}"
2045
- "--label=org.opencontainers.image.title={{.ProjectName}}"
2146
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
2247
- "--label=org.opencontainers.image.version={{.Version}}"
48+
goarch: amd64
49+
goamd64: v3
2350
extra_files:
2451
- LICENSE.md
2552
- README.md
2653
- pages/
54+
- image_templates:
55+
- &arm64v8_linux_image ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-arm64
56+
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-arm64
57+
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-arm64
58+
use: buildx
59+
build_flag_templates:
60+
- "--pull"
61+
- "--platform=linux/arm64"
62+
- "--label=org.opencontainers.image.created={{.Date}}"
63+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
64+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
65+
- "--label=org.opencontainers.image.version={{.Version}}"
66+
goarch: arm64
67+
extra_files:
68+
- LICENSE.md
69+
- README.md
70+
- pages/
71+
docker_manifests:
72+
- name_template: "ghcr.io/openchami/{{.ProjectName}}:latest"
73+
image_templates:
74+
- *amd64_linux_image
75+
- *arm64v8_linux_image
76+
77+
- name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}"
78+
image_templates:
79+
- *amd64_linux_image
80+
- *arm64v8_linux_image
81+
82+
- name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}"
83+
image_templates:
84+
- *amd64_linux_image
85+
- *arm64v8_linux_image
86+
87+
- name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}"
88+
image_templates:
89+
- *amd64_linux_image
90+
- *arm64v8_linux_image
91+
2792
archives:
2893
- format: tar.gz
2994
rlcp: true
@@ -39,18 +104,38 @@ archives:
39104
- LICENSE.md
40105
- README.md
41106
- pages/
107+
108+
nfpms:
109+
- id: bss
110+
formats:
111+
- deb
112+
- rpm
113+
- apk
114+
maintainer: "David Allen <allend@lanl.gov>"
115+
description: "OPAAL is a OIDC proxy bridge for creating tokens from trusted external OIDC providers for OpenCHAMI. Read more at https://www.openchami.org"
116+
homepage: "https://www.openchami.org"
117+
license: MIT
118+
section: utils
119+
priority: optional
120+
contents:
121+
- src: dist/bss_{{ .Os }}_{{ if eq .Arch "amd64" }}{{ .Arch }}_{{ .Amd64 }}{{ else if eq .Arch "arm64" }}{{ .Arch }}_{{ .Arm64 }}{{ else }}{{ .Arch }}{{ end }}/boot-script-service
122+
dst: /usr/local/bin/bss
123+
- src: dist/bss-init_{{ .Os }}_{{ if eq .Arch "amd64" }}{{ .Arch }}_{{ .Amd64 }}{{ else if eq .Arch "arm64" }}{{ .Arch }}_{{ .Arm64 }}{{ else }}{{ .Arch }}{{ end }}/bss-init
124+
dst: /usr/local/bin/bss-init
125+
42126
checksum:
43127
name_template: 'checksums.txt'
44128
snapshot:
45-
name_template: "{{ incpatch .Version }}-next"
129+
version_template: "{{ incpatch .Version }}-next"
46130
changelog:
47131
sort: asc
48132
filters:
49133
exclude:
50134
- '^docs:'
51135
- '^test:'
52-
# release:
53-
# github:
54-
# name_template: "{{.Version}}"
55-
# prerelease: auto
56-
# mode: append
136+
137+
138+
# The lines beneath this are called `modelines`. See `:help modeline`
139+
# Feel free to remove those if you don't want/use them.
140+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
141+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 commit comments

Comments
 (0)