---
kind: pipeline
type: exec
name: default

platform:
  arch: amd64
  os: linux

steps:
- name: check
  commands:
  - make check
  when:
    event:
    - pull_request
    - push

- name: release
  commands:
  - make prepare-assets
  - make latest-release
  environment:
    GIT_REPO: ${DRONE_REPO}
    GIT_TAG: ${DRONE_TAG:-latest}
    REPO_OWNER: ${DRONE_REPO_OWNER}
    REPO_NAME: ${DRONE_REPO_NAME}
    BOT_GITHUB_TOKEN:
      from_secret: github_token
  when:
    event:
    - push
