workspace:
  base: /go
  path: src/github.com/drone/drone-cli

pipeline:
  build:
    image: golang:1.9
    commands: sh .drone.sh

  publish_latest:
    image: plugins/docker
    repo: drone/cli
    secrets: [docker_username, docker_password]
    auto_tag: true

  publish_alpine:
    image: plugins/docker
    repo: drone/cli
    secrets: [docker_username, docker_password]
    auto_tag: true
    auto_tag_suffix: alpine
    dockerfile: Dockerfile.alpine

  publish_arm:
    image: plugins/docker
    repo: drone/cli
    secrets: [docker_username, docker_password]
    auto_tag: true
    auto_tag_suffix: arm
    dockerfile: Dockerfile.arm

  publish_arm64:
    image: plugins/docker
    repo: drone/cli
    secrets: [docker_username, docker_password]
    auto_tag: true
    auto_tag_suffix: arm64
    dockerfile: Dockerfile.arm64

  release:
    image: plugins/github-release
    files:
      - release/drone_*.tar.gz
      - release/drone_checksums.txt
    secrets:
      - source: github_token
        target: github_release_api_key
    when:
      event: tag
