1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-11 14:39:28 +02:00

docs: improve goreleaser build readme

refs #2710

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos A Becker 2021-11-30 10:41:05 -03:00
parent 62da2dbe13
commit eb4bee7f13
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -43,11 +43,20 @@ func newBuildCmd() *buildCmd {
Use: "build",
Aliases: []string{"b"},
Short: "Builds the current project",
Long: `The build command allows you to execute only a subset of the pipeline, i.e. only the build step with its dependencies.
Long: `The ` + "`goreleaser build`" + ` command is analogous to the
` + "`go build`" + ` command, in the sense it only builds binaries.
It allows you to quickly check if your GoReleaser build configurations are doing what you expect.
Its itented usage is, for example, within Makefiles to avoid setting up
ldflags and etc in several places. That way, the GoReleaser config becomes the
source of truth for how the binaries should be built.
Finally, it allows you to generate a local build for your current machine only using the ` + "`--single-target`" + ` option, and specific build IDs using the ` + "`--id`" + ` option.
It also allows you to generate a local build for your current machine only using
the ` + "`--single-target`" + ` option, and specific build IDs using the
` + "`--id`" + ` option in case you have more than one.
When using ` + "`--single-target`" + `, the ` + "`GOOS`" + ` and
` + "`GOARCH`" + ` environment variables are used to determine the target,
defaulting to the current's machine target if not set.
`,
SilenceUsage: true,
SilenceErrors: true,