github.com/joselitofilho/goreleaser@v0.155.1-0.20210123221854-e4891856c593/www/docs/install.md (about) 1 # Install 2 3 You can install the pre-compiled binary (in several different ways), 4 use Docker or compile from source. 5 6 Here are the steps for each of them: 7 8 ## Install the pre-compiled binary 9 10 **homebrew tap** (only on macOS for now): 11 12 ```sh 13 brew install goreleaser/tap/goreleaser 14 ``` 15 16 **homebrew** (may not be the latest version): 17 18 ```sh 19 brew install goreleaser 20 ``` 21 22 **snapcraft**: 23 24 ```sh 25 sudo snap install --classic goreleaser 26 ``` 27 28 **scoop**: 29 30 ```sh 31 scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git 32 scoop install goreleaser 33 ``` 34 35 **deb/rpm**: 36 37 Download the `.deb` or `.rpm` from the [releases page][releases] and 38 install with `dpkg -i` and `rpm -i` respectively. 39 40 **Shell script**: 41 42 ```sh 43 curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh 44 ``` 45 46 **manually**: 47 48 Download the pre-compiled binaries from the [releases page][releases] and 49 copy to the desired location. 50 51 ## Running with Docker 52 53 You can also use it within a Docker container. To do that, you'll need to 54 execute something more-or-less like the following: 55 56 ```sh 57 docker run --rm --privileged \ 58 -v $PWD:/go/src/github.com/user/repo \ 59 -v /var/run/docker.sock:/var/run/docker.sock \ 60 -w /go/src/github.com/user/repo \ 61 -e GITHUB_TOKEN \ 62 -e DOCKER_USERNAME \ 63 -e DOCKER_PASSWORD \ 64 -e DOCKER_REGISTRY \ 65 goreleaser/goreleaser release 66 ``` 67 68 !!! info 69 Currently, the provided docker image does not support 70 the generation of snapcraft packages. 71 72 Note that the image will almost always have the last stable Go version. 73 74 The `DOCKER_REGISTRY` environment variable can be left empty when you are 75 releasing to the public docker registry. 76 77 If you need more things, you are encouraged to keep your own image. You can 78 always use GoReleaser's [own Dockerfile][dockerfile] as an example though 79 and iterate from that. 80 81 [dockerfile]: https://github.com/goreleaser/goreleaser/blob/master/Dockerfile 82 [releases]: https://github.com/goreleaser/goreleaser/releases 83 84 ## Compiling from source 85 86 Here you have two options: 87 88 If you want to contribute to the project, please follow the 89 steps on our [contributing guide](/contributing). 90 91 If you just want to build from source for whatever reason, follow these steps: 92 93 **Clone:** 94 95 ```sh 96 git clone https://github.com/goreleaser/goreleaser 97 cd goreleaser 98 ``` 99 100 **Get the dependencies:** 101 102 ```sh 103 go get ./... 104 ``` 105 106 **Build:** 107 108 ```sh 109 go build -o goreleaser . 110 ``` 111 112 **Verify it works:** 113 114 ```sh 115 ./goreleaser --version 116 ```