From 7a365af5df3fd6fec2e1e9013e493fa7769260ce Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Fri, 22 May 2020 22:13:31 +0300 Subject: chore: simplify goreleaser flow, add bash completions to .deb (#3436) --- .goreleaser.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index e662799..325baf2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,12 +1,10 @@ before: hooks: - - mkdir -p caddy-build - - cp cmd/caddy/main.go caddy-build/main.go - - cp ./go.mod caddy-build/go.mod - - sed -i.bkp 's|github.com/caddyserver/caddy/v2|caddy|g' ./caddy-build/go.mod + - cp ./go.mod ./cmd/caddy/go.mod + - sed -i.bkp 's|github.com/caddyserver/caddy/v2|caddy|g' ./cmd/caddy/go.mod # GoReleaser doesn't seem to offer {{.Tag}} at this stage, so we have to embed it into the env # so we run: TAG=$(git describe --abbrev=0) goreleaser release --rm-dist --skip-publish --skip-validate - - go mod edit -require=github.com/caddyserver/caddy/v2@{{.Env.TAG}} ./caddy-build/go.mod + - go mod edit -require=github.com/caddyserver/caddy/v2@{{.Env.TAG}} ./cmd/caddy/go.mod - git clone --depth 1 https://github.com/caddyserver/dist caddy-dist - go mod download @@ -15,7 +13,7 @@ builds: - CGO_ENABLED=0 - GO111MODULE=on main: main.go - dir: ./caddy-build + dir: ./cmd/caddy binary: caddy goos: - darwin @@ -84,6 +82,7 @@ nfpms: ./caddy-dist/init/caddy.service: /lib/systemd/system/caddy.service ./caddy-dist/init/caddy-api.service: /lib/systemd/system/caddy-api.service ./caddy-dist/welcome/index.html: /usr/share/caddy/index.html + ./caddy-dist/scripts/completions/bash-completion: /etc/bash_completion.d/caddy config_files: ./caddy-dist/config/Caddyfile: /etc/caddy/Caddyfile -- cgit v1.2.3