File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11before :
22 hooks :
3- - cp ./go.mod ./cmd/caddy/go.mod
4- - sed -i.bkp 's|github.com/caddyserver/caddy/v2|caddy|g' ./cmd/caddy/go.mod
3+ # The build is done in this particular way to build Caddy in a designated directory named in .gitignore.
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+ - mkdir -p caddy-build
8+ - cp cmd/caddy/main.go caddy-build/main.go
9+ - cp ./go.mod caddy-build/go.mod
10+ - sed -i.bkp 's|github.com/caddyserver/caddy/v2|caddy|g' ./caddy-build/go.mod
511 # GoReleaser doesn't seem to offer {{.Tag}} at this stage, so we have to embed it into the env
612 # so we run: TAG=$(git describe --abbrev=0) goreleaser release --rm-dist --skip-publish --skip-validate
7- - go mod edit -require=github.com/caddyserver/caddy/v2@{{.Env.TAG}} ./cmd/ caddy/go.mod
13+ - go mod edit -require=github.com/caddyserver/caddy/v2@{{.Env.TAG}} ./caddy-build /go.mod
814 - git clone --depth 1 https://github.com/caddyserver/dist caddy-dist
915 - go mod download
1016
@@ -13,7 +19,7 @@ builds:
1319 - CGO_ENABLED=0
1420 - GO111MODULE=on
1521 main : main.go
16- dir : ./cmd/ caddy
22+ dir : ./caddy-build
1723 binary : caddy
1824 goos :
1925 - darwin
You can’t perform that action at this time.
0 commit comments