Debian Codegraph @

.goreleaser.yml

raw symbols SCIP
1 version: 2
2
3 before:
4 hooks:
5 # The build is done in this particular way to build Caddy in a designated directory named in .gitignore.
6 # This is so we can run goreleaser on tag without Git complaining of being dirty. The main.go in cmd/caddy directory
7 # cannot be built within that directory due to changes necessary for the build causing Git to be dirty, which
8 # subsequently causes gorleaser to refuse running.
9 - rm -rf caddy-build caddy-dist vendor
10 # vendor Caddy deps
11 - go mod vendor
12 - mkdir -p caddy-build
13 - cp cmd/caddy/main.go caddy-build/main.go
14 - /bin/sh -c 'cd ./caddy-build && go mod init caddy'
15 # prepare syso files for windows embedding
16 - /bin/sh -c 'for a in amd64 arm64; do XCADDY_SKIP_BUILD=1 GOOS=windows GOARCH=$a xcaddy build {{.Env.TAG}}; done'
17 - /bin/sh -c 'mv /tmp/buildenv_*/*.syso caddy-build'
18 # GoReleaser doesn't seem to offer {{.Tag}} at this stage, so we have to embed it into the env
19 # so we run: TAG=$(git describe --abbrev=0) goreleaser release --rm-dist --skip-publish --skip-validate
20 - go mod edit -require=github.com/caddyserver/caddy/v2@{{.Env.TAG}} ./caddy-build/go.mod
21 # as of Go 1.16, `go` commands no longer automatically change go.{mod,sum}. We now have to explicitly
22 # run `go mod tidy`. The `/bin/sh -c '...'` is because goreleaser can't find cd in PATH without shell invocation.
23 - /bin/sh -c 'cd ./caddy-build && go mod tidy'
24 # vendor the deps of the prepared to-build module
25 - /bin/sh -c 'cd ./caddy-build && go mod vendor'
26 - git clone --depth 1 https://github.com/caddyserver/dist caddy-dist
27 - mkdir -p caddy-dist/man
28 - go mod download
29 - go run cmd/caddy/main.go manpage --directory ./caddy-dist/man
30 - gzip -r ./caddy-dist/man/
31 - /bin/sh -c 'go run cmd/caddy/main.go completion bash > ./caddy-dist/scripts/bash-completion'
32
33 builds:
34 - env:
35 - CGO_ENABLED=0
36 - GO111MODULE=on
37 dir: ./caddy-build
38 binary: caddy
39 goos:
40 - darwin
41 - linux
42 - windows
43 - freebsd
44 goarch:
45 - amd64
46 - arm
47 - arm64
48 - s390x
49 - ppc64le
50 - riscv64
51 goarm:
52 - "5"
53 - "6"
54 - "7"
55 ignore:
56 - goos: darwin
57 goarch: arm
58 - goos: darwin
59 goarch: ppc64le
60 - goos: darwin
61 goarch: s390x
62 - goos: darwin
63 goarch: riscv64
64 - goos: windows
65 goarch: ppc64le
66 - goos: windows
67 goarch: s390x
68 - goos: windows
69 goarch: riscv64
70 - goos: windows
71 goarch: arm
72 - goos: freebsd
73 goarch: ppc64le
74 - goos: freebsd
75 goarch: s390x
76 - goos: freebsd
77 goarch: riscv64
78 - goos: freebsd
79 goarch: arm
80 goarm: "5"
81 flags:
82 - -trimpath
83 - -mod=readonly
84 ldflags:
85 - -s -w
86 tags:
87 - nobadger
88 - nomysql
89 - nopgx
90
91 signs:
92 - cmd: cosign
93 signature: "${artifact}.sig"
94 certificate: '{{ trimsuffix (trimsuffix .Env.artifact ".zip") ".tar.gz" }}.pem'
95 args: ["sign-blob", "--yes", "--output-signature=${signature}", "--output-certificate", "${certificate}", "${artifact}"]
96 artifacts: all
97
98 sboms:
99 - artifacts: binary
100 documents:
101 - >-
102 {{ .ProjectName }}_
103 {{- .Version }}_
104 {{- if eq .Os "darwin" }}mac{{ else }}{{ .Os }}{{ end }}_
105 {{- .Arch }}
106 {{- with .Arm }}v{{ . }}{{ end }}
107 {{- with .Mips }}_{{ . }}{{ end }}
108 {{- if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}.sbom
109 cmd: syft
110 args: ["$artifact", "--file", "${document}", "--output", "cyclonedx-json"]
111
112 archives:
113 - id: default
114 format_overrides:
115 - goos: windows
116 formats: zip
117 name_template: >-
118 {{ .ProjectName }}_
119 {{- .Version }}_
120 {{- if eq .Os "darwin" }}mac{{ else }}{{ .Os }}{{ end }}_
121 {{- .Arch }}
122 {{- with .Arm }}v{{ . }}{{ end }}
123 {{- with .Mips }}_{{ . }}{{ end }}
124 {{- if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}
125
126 # package the 'caddy-build' directory into a tarball,
127 # allowing users to build the exact same set of files as ours.
128 - id: source
129 meta: true
130 name_template: "{{ .ProjectName }}_{{ .Version }}_buildable-artifact"
131 files:
132 - src: LICENSE
133 dst: ./LICENSE
134 - src: README.md
135 dst: ./README.md
136 - src: AUTHORS
137 dst: ./AUTHORS
138 - src: ./caddy-build
139 dst: ./
140
141 source:
142 enabled: true
143 name_template: '{{ .ProjectName }}_{{ .Version }}_src'
144 format: 'tar.gz'
145
146 # Additional files/template/globs you want to add to the source archive.
147 #
148 # Default: empty.
149 files:
150 - vendor
151
152
153 checksum:
154 algorithm: sha512
155
156 nfpms:
157 - id: default
158 package_name: caddy
159
160 vendor: Dyanim
161 homepage: https://caddyserver.com
162 maintainer: Matthew Holt <[email protected]>
163 description: |
164 Caddy - Powerful, enterprise-ready, open source web server with automatic HTTPS written in Go
165 license: Apache 2.0
166
167 formats:
168 - deb
169 # - rpm
170
171 bindir: /usr/bin
172 contents:
173 - src: ./caddy-dist/init/caddy.service
174 dst: /lib/systemd/system/caddy.service
175
176 - src: ./caddy-dist/init/caddy-api.service
177 dst: /lib/systemd/system/caddy-api.service
178
179 - src: ./caddy-dist/welcome/index.html
180 dst: /usr/share/caddy/index.html
181
182 - src: ./caddy-dist/scripts/bash-completion
183 dst: /etc/bash_completion.d/caddy
184
185 - src: ./caddy-dist/config/Caddyfile
186 dst: /etc/caddy/Caddyfile
187 type: config
188
189 - src: ./caddy-dist/man/*
190 dst: /usr/share/man/man8/
191
192 scripts:
193 postinstall: ./caddy-dist/scripts/postinstall.sh
194 preremove: ./caddy-dist/scripts/preremove.sh
195 postremove: ./caddy-dist/scripts/postremove.sh
196
197 provides:
198 - httpd
199
200 release:
201 github:
202 owner: caddyserver
203 name: caddy
204 draft: true
205 prerelease: auto
206
207 changelog:
208 sort: asc
209 filters:
210 exclude:
211 - '^chore:'
212 - '^ci:'
213 - '^docs?:'
214 - '^readme:'
215 - '^tests?:'
216 - '^\w+\s+' # a hack to remove commit messages without colons thus don't correspond to a package