1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

docs: updated guide for travis

refs #351
This commit is contained in:
Carlos Alexandro Becker 2018-02-17 18:15:40 -02:00
parent ec1ba17102
commit 272fd3cd99
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -2,15 +2,47 @@
title: Continuous Integration
---
GoReleaser was built from the very first commit with the idea of
running it as part of the CI pipeline in mind.
Let's see how we can get it working on popular CI softwares.
## Travis
You may want to setup your project to auto-deploy your new tags on
[Travis](https://travis-ci.org), for example:
```yaml
# .travis.yml
after_success:
- test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash
language: go
# needed for the nfpm pipe
addons:
apt:
packages:
- rpm
# needed for the docker pipe
services:
- docker
# calls goreleaser
deploy:
- provider: script
skip_cleanup: true
script: curl -sL http://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
```
Note the last line (`condition: $TRAVIS_OS_NAME = linux`): it is important
if you run a build matrix with multiple Go versions and/or multiple OSes. If
that's the case you will want to make sure GoReleaser is run just once.
# Circle
Here is how to do it with [CircleCI](https://circleci.com):
```yml
@ -22,13 +54,3 @@ deployment:
commands:
- curl -sL https://git.io/goreleaser | bash
```
If you test multiple versions or multiple OSes, you probably want to
make sure GoReleaser is just run once.
You could change the above example for Travis CI like this:
```yaml
# .travis.yml
after_success:
- test "$TRAVIS_OS_NAME" = "linux" -a -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash
```