github.com/fitzix/goreleaser@v0.92.0/www/content/hooks.md (about) 1 --- 2 title: Global Hooks 3 series: customization 4 hideFromIndex: true 5 weight: 20 6 --- 7 8 Some builds may need pre-build steps before building, e.g. `go generate`. 9 The `before` section allows for global hooks which will be executed before 10 the build is started. 11 12 The configuration is very simple, here is a complete example: 13 14 ```yml 15 # .goreleaser.yml 16 before: 17 hooks: 18 - make clean 19 - go generate ./... 20 - go mod download 21 ``` 22 23 If any of the hooks fails the build process is aborted. 24 25 It is important to note that you can't have "complex" commands, like 26 `bash -c "echo foo bar"` or `foo | bar` or anything like that. If you need 27 to do things that are more complex than just calling a command with some 28 attributes, wrap it in a shell script or into your `Makefile`.