github.com/goreleaser/goreleaser@v1.25.1/www/docs/install.md (about) 1 # Install 2 3 There are two GoReleaser distributions: OSS and [Pro](/pro/). 4 5 You can install the pre-compiled binary (in several ways), use Docker or compile 6 from source (when on OSS). 7 8 Below you can find the steps for each of them. 9 10 ## Install the pre-compiled binary 11 12 ### homebrew tap 13 14 === "OSS" 15 16 ```bash 17 brew install goreleaser/tap/goreleaser 18 ``` 19 20 === "Pro" 21 22 ```bash 23 brew install goreleaser/tap/goreleaser-pro 24 ``` 25 26 ### homebrew 27 28 === "OSS" 29 30 ```bash 31 brew install goreleaser 32 ``` 33 34 !!! info 35 36 The [formula in homebrew-core](https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/goreleaser.rb) might be slightly outdated. 37 Use our homebrew tap to always get the latest updates. 38 39 ### snapcraft 40 41 === "OSS" 42 43 ```bash 44 sudo snap install --classic goreleaser 45 ``` 46 47 ### scoop 48 49 === "OSS" 50 51 ```bash 52 scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git 53 scoop install goreleaser 54 ``` 55 56 === "Pro" 57 58 ```bash 59 scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git 60 scoop install goreleaser-pro 61 ``` 62 63 ### apt 64 65 === "OSS" 66 67 ```bash 68 echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list 69 sudo apt update 70 sudo apt install goreleaser 71 ``` 72 73 === "Pro" 74 75 ```bash 76 echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list 77 sudo apt update 78 sudo apt install goreleaser-pro 79 ``` 80 81 ### yum 82 83 === "OSS" 84 85 ```bash 86 echo '[goreleaser] 87 name=GoReleaser 88 baseurl=https://repo.goreleaser.com/yum/ 89 enabled=1 90 gpgcheck=0' | sudo tee /etc/yum.repos.d/goreleaser.repo 91 sudo yum install goreleaser 92 ``` 93 94 === "Pro" 95 96 ```bash 97 echo '[goreleaser] 98 name=GoReleaser 99 baseurl=https://repo.goreleaser.com/yum/ 100 enabled=1 101 gpgcheck=0' | sudo tee /etc/yum.repos.d/goreleaser.repo 102 sudo yum install goreleaser-pro 103 ``` 104 105 ### aur 106 107 === "OSS" 108 109 ```bash 110 yay -S goreleaser-bin 111 ``` 112 113 === "Pro" 114 115 ```bash 116 yay -S goreleaser-pro-bin 117 ``` 118 119 ### nix 120 121 #### nixpkgs 122 123 === "OSS" 124 125 ```bash 126 nix-env -iA goreleaser 127 ``` 128 129 !!! info 130 131 The [package in nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/goreleaser/default.nix) 132 might be slightly outdated, as it is not updated automatically. 133 Use our NUR to always get the latest updates. 134 135 #### nur 136 137 First, you'll need to add our [NUR][nur] to your nix configuration. 138 You can follow the guides 139 [here](https://github.com/nix-community/NUR#installation). 140 141 Once you do that, you can install the packages. 142 143 [nur]: https://github.com/goreleaser/nur 144 145 === "OSS" 146 147 ```nix 148 { pkgs, lib, ... }: { 149 home.packages = with pkgs; [ 150 nur.repos.goreleaser.goreleaser 151 ]; 152 } 153 ``` 154 155 === "Pro" 156 157 ```nix 158 { pkgs, lib, ... }: { 159 home.packages = with pkgs; [ 160 nur.repos.goreleaser.goreleaser-pro 161 ]; 162 } 163 ``` 164 165 ### deb, rpm and apk packages 166 167 === "OSS" 168 169 Download the `.deb`, `.rpm` or `.apk` packages from the [OSS releases page][releases] and install them with the appropriate tools. 170 171 === "Pro" 172 173 Download the `.deb`, `.rpm` or `.apk` packages from the [Pro releases page][pro-releases] and install them with the appropriate tools. 174 175 ### go install 176 177 === "OSS" 178 179 ```bash 180 go install github.com/goreleaser/goreleaser@latest 181 ``` 182 183 Requires Go 1.22. 184 185 ### bash script 186 187 === "OSS" 188 189 ```bash 190 curl -sfL https://goreleaser.com/static/run | bash 191 ``` 192 193 === "Pro" 194 195 ```bash 196 curl -sfL https://goreleaser.com/static/run | DISTRIBUTION=pro bash 197 ``` 198 199 === "Additional Options" 200 201 You can also set the `VERSION` and `DISTRIBUTION` variables to specify 202 a version instead of using latest and `pro` or `oss` distributions, 203 respectively. 204 205 You can also pass flags and args to GoReleaser: 206 207 ```bash 208 curl -sfL https://goreleaser.com/static/run | 209 VERSION=__VERSION__ DISTRIBUTION=oss bash -s -- check 210 211 curl -sfL https://goreleaser.com/static/run | 212 VERSION=__VERSION__ DISTRIBUTION=pro bash -s -- check 213 ``` 214 215 !!! tip 216 217 This script does not install anything, it just downloads, verifies and 218 runs GoReleaser. 219 Its purpose is to be used within scripts and CIs. 220 221 ### manually 222 223 === "OSS" 224 225 Download the pre-compiled binaries from the [OSS releases page][releases] and copy them to the desired location. 226 227 === "Pro" 228 229 Download the pre-compiled binaries from the [Pro releases page][pro-releases] and copy them to the desired location. 230 231 ### nightly 232 233 Nightly build are pre-releases of the current code into the main branch. 234 Use it for testing out new features only. 235 236 #### manually 237 238 === "OSS" 239 240 Download the pre-compiled binaries from the [nightly release][nightly-releases] and copy them to the desired location. 241 242 === "Pro" 243 244 Download the pre-compiled binaries from the [nightly release][nightly-pro-releases] and copy them to the desired location. 245 246 ### bash script 247 248 === "OSS" 249 250 ```bash 251 curl -sfL https://goreleaser.com/static/run | 252 VERSION=nightly DISTRIBUTION=oss bash -s -- release --clean 253 ``` 254 255 === "Pro" 256 257 ```bash 258 curl -sfL https://goreleaser.com/static/run | 259 VERSION=nightly DISTRIBUTION=pro bash -s -- release --clean 260 ``` 261 262 #### docker 263 264 Docker images are also available, look for tags with a `-nightly` suffix for 265 the last nightly of a specific release, or the `:nightly` tag, 266 which is always the latest nightly build available. 267 268 === "OSS" 269 270 Registries: 271 272 - [`goreleaser/goreleaser`](https://hub.docker.com/r/goreleaser/goreleaser) 273 - [`ghcr.io/goreleaser/goreleaser`](https://github.com/goreleaser/goreleaser/pkgs/container/goreleaser) 274 275 === "Pro" 276 277 Registries: 278 279 - [`goreleaser/goreleaser-pro`](https://hub.docker.com/r/goreleaser/goreleaser-pro) 280 - [`ghcr.io/goreleaser/goreleaser-pro`](https://github.com/goreleaser/goreleaser/pkgs/container/goreleaser-pro) 281 282 ## Verifying the artifacts 283 284 ### binaries 285 286 All artifacts are checksummed, and the checksum file is signed with [cosign][]. 287 288 === "OSS" 289 290 1. Download the files you want, and the `checksums.txt`, `checksum.txt.pem` and `checksums.txt.sig` files from the [releases][releases] page: 291 ```bash 292 wget 'https://github.com/goreleaser/goreleaser/releases/download/__VERSION__/checksums.txt' 293 ``` 294 1. Verify the signature: 295 ```bash 296 cosign verify-blob \ 297 --certificate-identity 'https://github.com/goreleaser/goreleaser/.github/workflows/release.yml@refs/tags/__VERSION__' \ 298 --certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \ 299 --cert 'https://github.com/goreleaser/goreleaser/releases/download/__VERSION__/checksums.txt.pem' \ 300 --signature 'https://github.com/goreleaser/goreleaser/releases/download/__VERSION__/checksums.txt.sig' \ 301 ./checksums.txt 302 ``` 303 1. If the signature is valid, you can then verify the SHA256 sums match with the downloaded binary: 304 ```bash 305 sha256sum --ignore-missing -c checksums.txt 306 ``` 307 308 === "Pro" 309 310 1. Download the files you want, and the `checksums.txt`, `checksum.txt.pem` and `checksums.txt.sig` files from the [releases][pro-releases] page: 311 ```bash 312 wget 'https://github.com/goreleaser/goreleaser-pro/releases/download/__VERSION__-pro/checksums.txt' 313 ``` 314 1. Verify the signature: 315 ```bash 316 cosign verify-blob \ 317 --certificate-identity 'https://github.com/goreleaser/goreleaser-pro-internal/.github/workflows/release-pro.yml@refs/tags/__VERSION__-pro' \ 318 --certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \ 319 --cert 'https://github.com/goreleaser/goreleaser-pro/releases/download/__VERSION__-pro/checksums.txt.pem' \ 320 --signature 'https://github.com/goreleaser/goreleaser-pro/releases/download/__VERSION__-pro/checksums.txt.sig' \ 321 ./checksums.txt 322 ``` 323 1. If the signature is valid, you can then verify the SHA256 sums match with the downloaded binary: 324 ```bash 325 sha256sum --ignore-missing -c checksums.txt 326 ``` 327 328 ### docker images 329 330 Our Docker images are signed with [cosign][]. 331 332 Verify the signatures: 333 334 === "OSS" 335 336 ```bash 337 cosign verify \ 338 --certificate-identity 'https://github.com/goreleaser/goreleaser/.github/workflows/release.yml@refs/tags/__VERSION__' \ 339 --certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \ 340 goreleaser/goreleaser 341 ``` 342 343 === "Pro" 344 345 ```bash 346 cosign verify \ 347 --certificate-identity 'https://github.com/goreleaser/goreleaser-pro-internal/.github/workflows/release-pro.yml@refs/tags/__VERSION__-pro' \ 348 --certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \ 349 goreleaser/goreleaser-pro 350 ``` 351 352 !!! info 353 354 The `.pem` and `.sig` files are the image `name:tag`, replacing `/` and `:` with `-`. 355 356 ## Running with Docker 357 358 You can also use it within a Docker container. 359 To do that, you'll need to execute something more-or-less like the examples below. 360 361 === "OSS" 362 363 Registries: 364 365 - [`goreleaser/goreleaser`](https://hub.docker.com/r/goreleaser/goreleaser) 366 - [`ghcr.io/goreleaser/goreleaser`](https://github.com/goreleaser/goreleaser/pkgs/container/goreleaser) 367 368 Example usage: 369 370 ```bash 371 docker run --rm --privileged \ 372 -v $PWD:/go/src/github.com/user/repo \ 373 -v /var/run/docker.sock:/var/run/docker.sock \ 374 -w /go/src/github.com/user/repo \ 375 -e GITHUB_TOKEN \ 376 -e DOCKER_USERNAME \ 377 -e DOCKER_PASSWORD \ 378 -e DOCKER_REGISTRY \ 379 goreleaser/goreleaser release 380 ``` 381 382 === "Pro" 383 384 Registries: 385 386 - [`goreleaser/goreleaser-pro`](https://hub.docker.com/r/goreleaser/goreleaser-pro) 387 - [`ghcr.io/goreleaser/goreleaser-pro`](https://github.com/goreleaser/goreleaser/pkgs/container/goreleaser-pro) 388 389 Example usage: 390 391 ```bash 392 docker run --rm --privileged \ 393 -v $PWD:/go/src/github.com/user/repo \ 394 -v /var/run/docker.sock:/var/run/docker.sock \ 395 -w /go/src/github.com/user/repo \ 396 -e GITHUB_TOKEN \ 397 -e DOCKER_USERNAME \ 398 -e DOCKER_PASSWORD \ 399 -e DOCKER_REGISTRY \ 400 -e GORELEASER_KEY \ 401 goreleaser/goreleaser-pro release 402 ``` 403 404 !!! info 405 406 Now, the provided docker image does not support 407 the generation of Snapcraft packages. 408 409 Note that the image will almost always have the last stable Go version. 410 411 The `DOCKER_REGISTRY` environment variable can be left empty when you are 412 releasing to the public docker registry. 413 414 If you need more things, you are encouraged to keep your own image. You can 415 always use GoReleaser's [own Dockerfile][dockerfile] as an example though 416 and iterate from that. 417 418 [dockerfile]: https://github.com/goreleaser/goreleaser/blob/main/Dockerfile 419 [releases]: https://github.com/goreleaser/goreleaser/releases 420 [pro-releases]: https://github.com/goreleaser/goreleaser-pro/releases 421 [nightly-pro-releases]: https://github.com/goreleaser/goreleaser-pro/releases/nightly 422 [nightly-releases]: https://github.com/goreleaser/goreleaser/releases/nightly 423 [cosign]: https://github.com/sigstore/cosign 424 425 ## Packaging status 426 427 [](https://repology.org/project/goreleaser/versions) 428 429 ## Compiling from source 430 431 Here you have two options: 432 433 If you want to contribute to the project, please follow the 434 steps on our [contributing guide](/contributing). 435 436 If you just want to build from source for whatever reason, follow these steps: 437 438 **clone:** 439 440 ```bash 441 git clone https://github.com/goreleaser/goreleaser 442 cd goreleaser 443 ``` 444 445 **get the dependencies:** 446 447 ```bash 448 go mod tidy 449 ``` 450 451 **build:** 452 453 ```bash 454 go build -o goreleaser . 455 ``` 456 457 **verify it works:** 458 459 ```bash 460 ./goreleaser --version 461 ```