github.com/goreleaser/goreleaser@v1.25.1/www/docs/cmd/goreleaser_build.md (about)

     1  # goreleaser build
     2  
     3  Builds the current project
     4  
     5  ## Synopsis
     6  
     7  The `goreleaser build` command is analogous to the `go build` command, in the sense it only builds binaries.
     8  
     9  Its intended 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.
    10  
    11  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.
    12  
    13  When using `--single-target`, the `GOOS` and `GOARCH` environment variables are used to determine the target, defaulting to the current machine target if not set.
    14  
    15  
    16  ```
    17  goreleaser build [flags]
    18  ```
    19  
    20  ## Options
    21  
    22  ```
    23        --clean              Removes the 'dist' directory before building
    24    -f, --config string      Load configuration from file
    25    -h, --help               help for build
    26        --id stringArray     Builds only the specified build ids
    27    -o, --output string      Copy the binary to the path after the build. Only taken into account when using --single-target and a single id (either with --id or if configuration only has one build)
    28    -p, --parallelism int    Amount tasks to run concurrently (default: number of CPUs)
    29        --single-target      Builds only for current GOOS and GOARCH, regardless of what's set in the configuration file
    30        --skip strings       Skip the given options (valid options are: after, before, post-hooks, pre-hooks, validate)
    31        --snapshot           Generate an unversioned snapshot build, skipping all validations
    32        --timeout duration   Timeout to the entire build process (default 30m0s)
    33  ```
    34  
    35  ## Options inherited from parent commands
    36  
    37  ```
    38        --debug     Enable verbose mode (deprecated)
    39        --verbose   Enable verbose mode
    40  ```
    41  
    42  ## See also
    43  
    44  * [goreleaser](/cmd/goreleaser/)	 - Deliver Go binaries as fast and easily as possible
    45