Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 05:30 UTC
ci/cd: ship tarballs with vendored deps (#5403)
Mohammed Al Sahaf committed
Feb 27, 2023 at 01:06 UTC
096971e313e1a8a32433213d3f2cb81b73d02b5e
1 file changed
+43
-2
.goreleaser.yml
+43
-2
@@ -4,7 +4,9 @@ before:
4
# This is so we can run goreleaser on tag without Git complaining of being dirty. The main.go in cmd/caddy directory
5
# cannot be built within that directory due to changes necessary for the build causing Git to be dirty, which
6
# subsequently causes gorleaser to refuse running.
7
- - rm -rf caddy-build caddy-dist
7
+ - rm -rf caddy-build caddy-dist vendor
8
+ # vendor Caddy deps
9
+ - go mod vendor
10
- mkdir -p caddy-build
11
- cp cmd/caddy/main.go caddy-build/main.go
12
- /bin/sh -c 'cd ./caddy-build && go mod init caddy'
@@ -14,6 +16,8 @@ before:
16
# as of Go 1.16, `go` commands no longer automatically change go.{mod,sum}. We now have to explicitly
17
# run `go mod tidy`. The `/bin/sh -c '...'` is because goreleaser can't find cd in PATH without shell invocation.
18
- /bin/sh -c 'cd ./caddy-build && go mod tidy'
19
+ # vendor the deps of the prepared to-build module
20
+ - /bin/sh -c 'cd ./caddy-build && go mod vendor'
21
- git clone --depth 1 https://github.com/caddyserver/dist caddy-dist
22
- mkdir -p caddy-dist/man
23
- go mod download
@@ -89,7 +93,8 @@ sboms:
93
args: ["$artifact", "--file", "${document}", "--output", "cyclonedx-json"]
94
95
archives:
92
- - format_overrides:
96
+ - id: default
97
+ format_overrides:
98
- goos: windows
99
format: zip
100
name_template: >-
@@ -100,6 +105,42 @@ archives:
105
{{- with .Arm }}v{{ . }}{{ end }}
106
{{- with .Mips }}_{{ . }}{{ end }}
107
{{- if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}
108
+
109
+ # packge the 'caddy-build' directory into a tarball,
110
+ # allowing users to build the exact same set of files as ours.
111
+ - id: source
112
+ meta: true
113
+ rlcp: true
114
+ name_template: "{{ .ProjectName }}_{{ .Version }}_buildable-artifact"
115
+ files:
116
+ - src: LICENSE
117
+ dst: ./LICENSE
118
+ - src: README.md
119
+ dst: ./README.md
120
+ - src: AUTHORS
121
+ dst: ./AUTHORS
122
+ - src: ./caddy-build
123
+ dst: ./
124
+
125
+source:
126
+ enabled: true
127
+ name_template: '{{ .ProjectName }}_{{ .Version }}_src'
128
+ format: 'tar.gz'
129
+
130
+ # This will make the destination paths be relative to the longest common
131
+ # path prefix between all the files matched and the source glob.
132
+ # Enabling this essentially mimic the behavior of nfpm's contents section.
133
+ # It will be the default by June 2023.
134
+ #
135
+ # Default: false
136
+ rlcp: true
137
+
138
+ # Additional files/template/globs you want to add to the source archive.
139
+ #
140
+ # Default: empty.
141
+ files:
142
+ - vendor
143
+
144
145
checksum:
146
algorithm: sha512