Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 12, 07:00 UTC
ci: install xcaddy to fix release flow (#6602)
Mohammed Al Sahaf committed
Oct 2, 2024 at 19:12 UTC
01be1b54a8c9b7e6ea52af8165c583d4d2ebe7e3
4 files changed
+22
-4
.github/workflows/ci.yml
+15
@@ -202,3 +202,18 @@ jobs:
202
with:
203
version: latest
204
args: check
205
+ - name: Install Go
206
+ uses: actions/setup-go@v5
207
+ with:
208
+ go-version: "~1.23"
209
+ check-latest: true
210
+ - name: Install xcaddy
211
+ run: |
212
+ go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
213
+ xcaddy version
214
+ - uses: goreleaser/goreleaser-action@v6
215
+ with:
216
+ version: latest
217
+ args: build --single-target --snapshot
218
+ env:
219
+ TAG: "master"
.github/workflows/release.yml
+4
@@ -104,6 +104,10 @@ jobs:
104
uses: anchore/sbom-action/download-syft@main
105
- name: Syft version
106
run: syft version
107
+ - name: Install xcaddy
108
+ run: |
109
+ go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
110
+ xcaddy version
111
# GoReleaser will take care of publishing those artifacts into the release
112
- name: Run GoReleaser
113
uses: goreleaser/goreleaser-action@v6
.goreleaser.yml
+1
-2
@@ -13,8 +13,7 @@ before:
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
- - go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
17
- - /bin/sh -c 'for a in amd64 arm arm64; do XCADDY_SKIP_BUILD=1 GOOS=windows GOARCH=$a $GOPATH/bin/xcaddy build {{.Env.TAG}}; done'
16
+ - /bin/sh -c 'for a in amd64 arm 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
cmd/commands.go
+2
-2
@@ -439,7 +439,7 @@ EXPERIMENTAL: May be changed or removed.
439
})
440
441
defaultFactory.Use(func(rootCmd *cobra.Command) {
442
- RegisterCommand(Command{
442
+ rootCmd.AddCommand(caddyCmdToCobra(Command{
443
Name: "manpage",
444
Usage: "--directory <path>",
445
Short: "Generates the manual pages for Caddy commands",
@@ -469,7 +469,7 @@ argument of --directory. If the directory does not exist, it will be created.
469
return caddy.ExitCodeSuccess, nil
470
})
471
},
472
- })
472
+ }))
473
474
// source: https://github.com/spf13/cobra/blob/main/shell_completions.md
475
rootCmd.AddCommand(&cobra.Command{