www/content/customization/general/partial.md
With GoReleaser Pro, you can split and merge goreleaser release runs.
{{< g_featpro >}}
This feature can help in some areas:
You don't really need to set anything up. To get started, run:
goreleaser release --clean --split
GOOS=darwin goreleaser release --clean --split
GGOOS=windows goreleaser release --clean --split
Note that this step will push your Docker images as well. Docker manifests are not created yet, though.
GOOS (as returned by
runtime.GOOS).GOOS. This env will also bleed to
things like before hooks, so be aware that any go run commands ran by
GoReleaser there might fail.GGOOS, which is used only to filter
which targets should be build, and does not affect anything else (as the
second option does).Those commands will create the needed artifacts for each platform in
dist/$GOOS.
You can also specify GOARCH and GGOARCH, which only take effect if you set
partial.by to target.
Now, to continue, run:
goreleaser continue --merge
This last step will run some extra things that were not run during the previous step:
[!WARNING] Please notice that this step will not run anything that the previous step already did. For example, it will not build anything again, nor run any
hooksyou have defined. It will only merge the previous results and publish them.
You can also run the publishing and announce steps separately:
goreleaser publish --merge
goreleaser announce --merge
You can choose by what you want your pipeline to be split by:
partial:
# By what you want to build the partial things.
#
# Valid options are `target` and `goos`:
# - `target`: `GOOS` + `GOARCH`.
# - `goos`: `GOOS` only
#
# Default: `goos`.
by: target
You can find an example project here. Feel free to dive into the workflow and the GoReleaser configuration.
The main thing to keep an eye on is the use of the cache action. Make sure to use a specific key for the release to prevent mixing, for example, a snapshot or nightly build with a production one.