1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/www/content/ci.md

68 lines
1.3 KiB
Markdown
Raw Normal View History

2017-09-10 22:07:28 +02:00
---
2017-12-20 12:32:21 +02:00
title: Continuous Integration
menu: true
weight: 140
2017-09-10 22:07:28 +02:00
---
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
2017-09-11 15:13:14 +02:00
[Travis](https://travis-ci.org), for example:
2017-09-10 22:07:28 +02:00
```yaml
# .travis.yml
language: go
addons:
apt:
packages:
2018-02-19 01:37:59 +02:00
# needed for the nfpm pipe:
- rpm
2018-02-19 01:37:59 +02:00
# needed for the snap pipe:
- snapcraft
env:
# needed for the snap pipe:
- PATH=/snap/bin:$PATH
install:
# needed for the snap pipe:
- sudo snap install snapcraft --classic
# needed for the docker pipe
services:
- docker
# calls goreleaser
deploy:
- provider: script
skip_cleanup: true
2018-04-07 17:59:39 +02:00
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
2017-09-10 22:07:28 +02:00
```
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
2017-09-10 22:07:28 +02:00
Here is how to do it with [CircleCI](https://circleci.com):
```yml
# circle.yml
deployment:
tag:
tag: /v[0-9]+(\.[0-9]+)*(-.*)*/
owner: user
commands:
- curl -sL https://git.io/goreleaser | bash
```