github.com/ahmet2mir/goreleaser@v0.180.3-0.20210927151101-8e5ee5a9b8c5/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 different ways), use Docker or compile from source (when on OSS). 6 7 Below you can find the steps for each of them. 8 9 ## Install the pre-compiled binary 10 11 ### homebrew tap 12 13 === "OSS" 14 ```sh 15 brew install goreleaser/tap/goreleaser 16 ``` 17 18 === "Pro" 19 ```sh 20 brew install goreleaser/tap/goreleaser-pro 21 ``` 22 23 ### homebrew 24 25 === "OSS" 26 ```sh 27 brew install goreleaser 28 ``` 29 30 !!! info 31 The [formula in homebrew-core](https://github.com/Homebrew/homebrew-core/blob/master/Formula/goreleaser.rb) might be slightly outdated. 32 Use our homebrew tap to always get the latest updates. 33 34 ### snapcraft 35 36 === "OSS" 37 ```sh 38 sudo snap install --classic goreleaser 39 ``` 40 41 ### scoop 42 43 === "OSS" 44 ```sh 45 scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git 46 scoop install goreleaser 47 ``` 48 49 === "Pro" 50 ```sh 51 scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git 52 scoop install goreleaser-pro 53 ``` 54 55 ### apt 56 57 === "OSS" 58 ```sh 59 echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list 60 sudo apt update 61 sudo apt install goreleaser 62 ``` 63 64 === "Pro" 65 ```sh 66 echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list 67 sudo apt update 68 sudo apt install goreleaser-pro 69 ``` 70 71 ### yum 72 73 === "OSS" 74 ```sh 75 echo '[goreleaser] 76 name=GoReleaser 77 baseurl=https://repo.goreleaser.com/yum/ 78 enabled=1 79 gpgcheck=0' | sudo tee /etc/yum.repos.d/goreleaser.repo 80 sudo yum install goreleaser 81 ``` 82 83 === "Pro" 84 ```sh 85 echo '[goreleaser] 86 name=GoReleaser 87 baseurl=https://repo.goreleaser.com/yum/ 88 enabled=1 89 gpgcheck=0' | sudo tee /etc/yum.repos.d/goreleaser.repo 90 sudo yum install goreleaser-pro 91 ``` 92 93 ### deb, rpm and apk packages 94 95 96 === "OSS" 97 Download the `.deb`, `.rpm` or `.apk` packages from the [OSS releases page][releases] and install them with the appropriate tools. 98 99 === "Pro" 100 Download the `.deb`, `.rpm` or `.apk` packages from the [Pro releases page][pro-releases] and install them with the appropriate tools. 101 102 103 ### shell script 104 105 === "OSS" 106 ```sh 107 curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh 108 ``` 109 110 111 <!-- TODO: write a new shell script and store it within the website --> 112 113 ### go install 114 115 === "OSS" 116 ```sh 117 go install github.com/goreleaser/goreleaser@latest 118 ``` 119 120 ### manually 121 122 === "OSS" 123 Download the pre-compiled binaries from the [OSS releases page][releases] and copy them to the desired location. 124 125 === "Pro" 126 Download the pre-compiled binaries from the [Pro releases page][pro-releases] and copy them to the desired location. 127 128 ## Verifying the binaries 129 130 All artifacts are checksummed and the checksum file is signed with [cosign][]. 131 132 You can verify it using [our public key](https://goreleaser.com/static/goreleaser.pub). 133 134 === "OSS" 135 1. Download the files you want, the `checksums.txt` and `checksums.txt.sig` files from the [releases][releases] page. 136 1. Verify the signature: 137 ```sh 138 cosign verify-blob \ 139 -key https://goreleaser.com/static/goreleaser.pub \ 140 -signature checksums.txt.sig \ 141 checksums.txt 142 ``` 143 1. If the signature is valid, you can then verify the SHA256 sums match with the downloaded binary: 144 ```sh 145 sha256sum --ignore-missing -c checksums.txt 146 ``` 147 148 === "Pro" 149 1. Download the files you want, the `checksums.txt` and `checksums.txt.sig` files from the [releases][pro-releases] page. 150 1. Verify the signature: 151 ```sh 152 cosign verify-blob \ 153 -key https://goreleaser.com/static/goreleaser.pub \ 154 -signature checksums.txt.sig \ 155 checksums.txt 156 ``` 157 1. If the signature is valid, you can then verify the SHA256 sums match with the downloaded binary: 158 ```sh 159 sha256sum --ignore-missing -c checksums.txt 160 ``` 161 162 ## Verifying docker images 163 164 Our Docker image is signed with [cosign][]. 165 166 You can verify it using [our public key](https://goreleaser.com/static/goreleaser.pub). 167 168 === "OSS" 169 Verify the signatures: 170 ```sh 171 cosign verify \ 172 -key https://goreleaser.com/static/goreleaser.pub \ 173 goreleaser/goreleaser 174 cosign verify \ 175 -key https://goreleaser.com/static/goreleaser.pub \ 176 ghcr.io/goreleaser/goreleaser 177 ``` 178 179 === "Pro" 180 Verify the signatures: 181 ```sh 182 cosign verify \ 183 -key https://goreleaser.com/static/goreleaser.pub \ 184 goreleaser/goreleaser-pro 185 cosign verify \ 186 -key https://goreleaser.com/static/goreleaser.pub \ 187 ghcr.io/goreleaser/goreleaser-pro 188 ``` 189 190 ## Running with Docker 191 192 You can also use it within a Docker container. 193 To do that, you'll need to execute something more-or-less like the examples below. 194 195 === "OSS" 196 Registries: 197 198 - [`goreleaser/goreleaser`](https://hub.docker.com/r/goreleaser/goreleaser) 199 - [`ghcr.io/goreleaser/goreleaser`](https://github.com/orgs/goreleaser/packages/container/package/goreleaser) 200 201 Example usage: 202 203 ```sh 204 docker run --rm --privileged \ 205 -v $PWD:/go/src/github.com/user/repo \ 206 -v /var/run/docker.sock:/var/run/docker.sock \ 207 -w /go/src/github.com/user/repo \ 208 -e GITHUB_TOKEN \ 209 -e DOCKER_USERNAME \ 210 -e DOCKER_PASSWORD \ 211 -e DOCKER_REGISTRY \ 212 goreleaser/goreleaser release 213 ``` 214 215 === "Pro" 216 Registries: 217 218 - [`goreleaser/goreleaser-pro`](https://hub.docker.com/r/goreleaser/goreleaser-pro) 219 - [`ghcr.io/goreleaser/goreleaser-pro`](https://github.com/orgs/goreleaser/packages/container/package/goreleaser-pro) 220 221 Example usage: 222 223 ```sh 224 docker run --rm --privileged \ 225 -v $PWD:/go/src/github.com/user/repo \ 226 -v /var/run/docker.sock:/var/run/docker.sock \ 227 -w /go/src/github.com/user/repo \ 228 -e GITHUB_TOKEN \ 229 -e DOCKER_USERNAME \ 230 -e DOCKER_PASSWORD \ 231 -e DOCKER_REGISTRY \ 232 -e GORELEASER_KEY \ 233 goreleaser/goreleaser-pro release 234 ``` 235 236 237 !!! info 238 Currently, the provided docker image does not support 239 the generation of snapcraft packages. 240 241 Note that the image will almost always have the last stable Go version. 242 243 The `DOCKER_REGISTRY` environment variable can be left empty when you are 244 releasing to the public docker registry. 245 246 If you need more things, you are encouraged to keep your own image. You can 247 always use GoReleaser's [own Dockerfile][dockerfile] as an example though 248 and iterate from that. 249 250 [dockerfile]: https://github.com/goreleaser/goreleaser/blob/master/Dockerfile 251 [releases]: https://github.com/goreleaser/goreleaser/releases 252 [pro-releases]: https://github.com/goreleaser/goreleaser-pro/releases 253 [cosign]: https://github.com/sigstore/cosign 254 255 ## Compiling from source 256 257 Here you have two options: 258 259 If you want to contribute to the project, please follow the 260 steps on our [contributing guide](/contributing/). 261 262 If you just want to build from source for whatever reason, follow these steps: 263 264 **clone:** 265 266 ```sh 267 git clone https://github.com/goreleaser/goreleaser 268 cd goreleaser 269 ``` 270 271 **get the dependencies:** 272 273 ```sh 274 go mod tidy 275 ``` 276 277 **build:** 278 279 ```sh 280 go build -o goreleaser . 281 ``` 282 283 **verify it works:** 284 285 ```sh 286 ./goreleaser --version 287 ```