mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fix: Use go mod download (#1345)
Recommend using `go mod download` rather than `go mod tidy` for fetching dependencies. The `tidy` function is used to update things and chagnes the dependency graph. Using the `download` function avoids any changes. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
a099acf5f5
commit
7625a70812
@ -3,7 +3,7 @@ env:
|
||||
- GOPROXY=https://gocenter.io
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
- go mod download
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
|
@ -6,8 +6,8 @@ const ExampleConfig = `# This is an example goreleaser.yaml file with some sane
|
||||
# Make sure to check the documentation at http://goreleaser.com
|
||||
before:
|
||||
hooks:
|
||||
# you may remove this if you don't use vgo
|
||||
- go mod tidy
|
||||
# You may remove this if you don't use go modules.
|
||||
- go mod download
|
||||
# you may remove this if you don't need go generate
|
||||
- go generate ./...
|
||||
builds:
|
||||
|
@ -138,13 +138,13 @@ GOVERSION=$(go version) goreleaser
|
||||
try to download the dependencies. Since several builds run in parallel, it is
|
||||
very likely to fail.
|
||||
|
||||
You can solve this by running `go mod tidy` before calling `goreleaser` or
|
||||
You can solve this by running `go mod download` before calling `goreleaser` or
|
||||
by adding a [hook][] doing that on your `.goreleaser.yaml` file:
|
||||
|
||||
```yaml
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
- go mod download
|
||||
# rest of the file...
|
||||
```
|
||||
|
||||
|
@ -16,11 +16,11 @@ env:
|
||||
- GO111MODULE=on
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
- go mod download
|
||||
builds:
|
||||
- binary: program
|
||||
```
|
||||
|
||||
This way, both `go mod tidy` and the underlying `go build` will have
|
||||
This way, both `go mod download` and the underlying `go build` will have
|
||||
`GO111MODULE` set to `on`.
|
||||
|
||||
|
@ -18,7 +18,7 @@ before:
|
||||
hooks:
|
||||
- make clean
|
||||
- go generate ./...
|
||||
- go mod tidy
|
||||
- go mod download
|
||||
- touch {{ .Env.FILE_TO_TOUCH }}
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user