github.com/goreleaser/goreleaser@v1.25.1/www/docs/ci/travis.md (about)

     1  # Travis CI
     2  
     3  You may want to set up your project to auto-deploy your new tags on
     4  [Travis](https://travis-ci.org), for example:
     5  
     6  ```yaml
     7  # .travis.yml
     8  language: go
     9  
    10  # needed only if you use the snap pipe:
    11  addons:
    12    apt:
    13      packages:
    14      - snapcraft
    15  
    16  # needed only if you use the Docker pipe
    17  services:
    18  - docker
    19  
    20  script:
    21    - go test ./... # replace this with your test script
    22    - curl -sfL https://goreleaser.com/static/run | bash -s -- check # check goreleaser config for deprecations
    23  
    24  after_success:
    25  # Docker login is required if you want to push Docker images.
    26  # DOCKER_PASSWORD should be a secret in your .travis.yml configuration.
    27  - test -n "$TRAVIS_TAG" && docker login -u=myuser -p="$DOCKER_PASSWORD"
    28  # snapcraft login is required if you want to push snapcraft packages to the
    29  # store.
    30  # You'll need to run `snapcraft export-login snap.login` and
    31  # `travis encrypt-file snap.login --add` to add the key to the travis
    32  # environment.
    33  - test -n "$TRAVIS_TAG" && snapcraft login --with snap.login
    34  
    35  # calls goreleaser
    36  deploy:
    37  - provider: script
    38    skip_cleanup: true
    39    script: curl -sfL https://goreleaser.com/static/run | bash
    40    on:
    41      tags: true
    42      condition: $TRAVIS_OS_NAME = linux
    43  ```
    44  
    45  Note the last line (`condition: $TRAVIS_OS_NAME = linux`): it is important
    46  if you run a build matrix with multiple Go versions and/or multiple OSes. If
    47  that's the case you will want to make sure GoReleaser is run just once.