github.com/goreleaser/goreleaser@v1.25.1/www/docs/customization/partial.md (about) 1 # Splitting and Merging builds 2 3 GoReleaser can also split and merge builds. 4 5 > Since: v1.12 (pro) 6 7 !!! success "GoReleaser Pro" 8 This subcommand is a [GoReleaser Pro feature](https://goreleaser.com/pro/). 9 10 This feature can help in some areas: 11 12 1. CGO, as you can build each platform in their target OS and merge later; 13 1. Native packaging and signing for Windows and macOS (more features for this 14 will be added soon); 15 1. Speed up slow builds, by splitting them into multiple workers; 16 17 ## Usage 18 19 You don't really need to set anything up. To get started, run: 20 21 ```bash 22 goreleaser release --clean --split 23 GOOS=darwin goreleaser release --clean --split 24 GGOOS=windows goreleaser release --clean --split 25 ``` 26 27 Note that this step will push your Docker images as well. 28 Docker manifests are not created yet, though. 29 30 - In the first example, it'll build for the current `GOOS` (as returned by 31 `runtime.GOOS`). 32 - In the second, it'll use the informed `GOOS`. This env will also bleed to 33 things like before hooks, so be aware that any `go run` commands ran by 34 GoReleaser there might fail. 35 - The third example uses the informed `GGOOS`, which is used only to filter 36 which targets should be build, and does not affect anything else (as the 37 second option does). 38 39 Those commands will create the needed artifacts for each platform in 40 `dist/$GOOS`. 41 42 You can also specify `GOARCH` and `GGOARCH`, which only take effect if you set 43 `partial.by` to `target`. 44 45 Now, to continue, run: 46 47 ```bash 48 goreleaser continue --merge 49 ``` 50 51 This last step will run some extra things that were not run during the previous 52 step: 53 54 - merge previous contexts and artifacts lists 55 - pull previously built images 56 - create the source archive (if enabled) 57 - checksum all artifacts 58 - sign artifacts (according to configuration) 59 - SBOM artifacts (according to configuration) 60 - run all the publishers 61 - run all the announcers 62 63 !!! warning 64 Please notice that this step will not run anything that the previous step 65 already did. 66 For example, it will not build anything again, nor run any `hooks` you have 67 defined. 68 It will only merge the previous results and publish them. 69 70 You can also run the publishing and announce steps separately: 71 72 ```bash 73 goreleaser publish --merge 74 goreleaser announce --merge 75 ``` 76 77 ## Customization 78 79 You can choose by what you want your pipeline to be split by: 80 81 ```yaml 82 # goreleaser.yaml 83 partial: 84 # By what you want to build the partial things. 85 # 86 # Valid options are `target` and `goos`: 87 # - `target`: `GOOS` + `GOARCH`. 88 # - `goos`: `GOOS` only 89 # 90 # Default: `goos`. 91 by: target 92 ``` 93 94 ## Integration with GitHub Actions 95 96 You can find an example project 97 [here](https://github.com/caarlos0/goreleaser-pro-split-merge-example). 98 Feel free to dive into the workflow and the GoReleaser config.