2020-05-10 21:57:11 +02:00
|
|
|
# Install
|
2018-11-22 21:01:25 +02:00
|
|
|
|
2019-03-25 01:10:30 +02:00
|
|
|
You can install the pre-compiled binary (in several different ways),
|
|
|
|
use Docker or compile from source.
|
|
|
|
|
|
|
|
Here are the steps for each of them:
|
2018-11-22 21:01:25 +02:00
|
|
|
|
|
|
|
## Install the pre-compiled binary
|
|
|
|
|
2019-03-25 01:10:30 +02:00
|
|
|
**homebrew tap** (only on macOS for now):
|
2018-11-22 21:01:25 +02:00
|
|
|
|
|
|
|
```sh
|
|
|
|
$ brew install goreleaser/tap/goreleaser
|
|
|
|
```
|
|
|
|
|
|
|
|
**homebrew** (may not be the latest version):
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ brew install goreleaser
|
|
|
|
```
|
|
|
|
|
|
|
|
**snapcraft**:
|
|
|
|
|
|
|
|
```sh
|
2019-06-06 06:20:35 +02:00
|
|
|
$ sudo snap install --classic goreleaser
|
2018-11-22 21:01:25 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
**scoop**:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git
|
|
|
|
$ scoop install goreleaser
|
|
|
|
```
|
|
|
|
|
|
|
|
**deb/rpm**:
|
|
|
|
|
|
|
|
Download the `.deb` or `.rpm` from the [releases page][releases] and
|
|
|
|
install with `dpkg -i` and `rpm -i` respectively.
|
|
|
|
|
2019-10-20 16:00:29 +02:00
|
|
|
**Shell script**:
|
|
|
|
|
2020-01-08 16:02:04 +02:00
|
|
|
```sh
|
2019-10-20 16:00:29 +02:00
|
|
|
$ curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
|
|
|
|
```
|
|
|
|
|
2018-11-22 21:01:25 +02:00
|
|
|
**manually**:
|
|
|
|
|
|
|
|
Download the pre-compiled binaries from the [releases page][releases] and
|
|
|
|
copy to the desired location.
|
|
|
|
|
|
|
|
## Running with Docker
|
|
|
|
|
2019-03-25 01:10:30 +02:00
|
|
|
You can also use it within a Docker container. To do that, you'll need to
|
|
|
|
execute something more-or-less like the following:
|
2018-11-22 21:01:25 +02:00
|
|
|
|
|
|
|
```sh
|
|
|
|
$ docker run --rm --privileged \
|
|
|
|
-v $PWD:/go/src/github.com/user/repo \
|
|
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
|
|
-w /go/src/github.com/user/repo \
|
|
|
|
-e GITHUB_TOKEN \
|
|
|
|
-e DOCKER_USERNAME \
|
|
|
|
-e DOCKER_PASSWORD \
|
2018-12-10 17:45:01 +02:00
|
|
|
-e DOCKER_REGISTRY \
|
2018-11-22 21:01:25 +02:00
|
|
|
goreleaser/goreleaser release
|
|
|
|
```
|
|
|
|
|
2020-05-10 21:57:11 +02:00
|
|
|
!!! info
|
|
|
|
Currently, the provided docker image does not support
|
|
|
|
the generation of snapcraft packages.
|
2019-03-25 01:10:30 +02:00
|
|
|
|
2018-11-22 21:01:25 +02:00
|
|
|
Note that the image will almost always have the last stable Go version.
|
|
|
|
|
2019-03-25 01:10:30 +02:00
|
|
|
The `DOCKER_REGISTRY` environment variable can be left empty when you are
|
2018-12-10 17:45:01 +02:00
|
|
|
releasing to the public docker registry.
|
|
|
|
|
2019-03-25 01:10:30 +02:00
|
|
|
If you need more things, you are encouraged to keep your own image. You can
|
|
|
|
always use GoReleaser's [own Dockerfile][dockerfile] as an example though
|
|
|
|
and iterate from that.
|
2018-11-22 21:01:25 +02:00
|
|
|
|
|
|
|
[dockerfile]: https://github.com/goreleaser/goreleaser/blob/master/Dockerfile
|
|
|
|
[releases]: https://github.com/goreleaser/goreleaser/releases
|
|
|
|
|
2020-05-10 21:57:11 +02:00
|
|
|
### Compiling from source
|
2018-11-22 21:01:25 +02:00
|
|
|
|
2019-05-14 16:22:56 +02:00
|
|
|
Here you have two options:
|
|
|
|
|
|
|
|
1. If you want to contribute to the project, please follow the
|
|
|
|
steps on our [contributing guide](/contributing).
|
|
|
|
2. If just want to build from source for whatever reason, follow the steps
|
|
|
|
bellow:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
# clone it outside GOPATH
|
|
|
|
git clone https://github.com/goreleaser/goreleaser
|
|
|
|
cd goreleaser
|
|
|
|
|
|
|
|
# get dependencies using go modules (needs go 1.11+)
|
|
|
|
go get ./...
|
|
|
|
|
|
|
|
# build
|
|
|
|
go build -o goreleaser .
|
|
|
|
|
|
|
|
# check it works
|
|
|
|
./goreleaser --version
|
|
|
|
```
|