1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
goreleaser/www/docs/ci/drone.md
Carlos Alexandro Becker 943ef1d81f
docs: improvements (#1501)
* docs: enable instant

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: minify html

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: edit uri

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: remove uneeded meta

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* docs: several improvements

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: broken links

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-05-10 18:59:21 -03:00

1.2 KiB

Drone

By default, drone does not fetch tags. plugins/git is used with default values, in most cases we'll need overwrite the clone step enabling tags in order to make goreleaser work correctly.

In this example we're creating a new release every time a new tag is pushed. Note that you'll need to enable tags in repo settings and add github_token secret.

1.x

# .drone.yml

kind: pipeline
name: default

steps:
  - name: fetch
    image: docker:git
    commands:
      - git fetch --tags

  - name: test
    image: golang
    volumes:
      - name: deps
        path: /go
    commands:
      - go test -race -v ./... -cover

  - name: release
    image: golang
    environment:
      GITHUB_TOKEN:
        from_secret: github_token
    volumes:
      - name: deps
        path: /go
    commands:
      - curl -sL https://git.io/goreleaser | bash
    when:
      event: tag

volumes:
  - name: deps
    temp: {}

0.8

pipeline:
  clone:
    image: plugins/git
    tags: true

  test:
    image: golang:1.10
    commands:
      - go test ./... -race

  release:
    image: golang:1.10
    secrets: [github_token]
    commands:
      curl -sL https://git.io/goreleaser | bash
    when:
      event: tag