kind: pipeline
name: default

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

- name: buildci
  image: golang
  commands:
    - apt-get update && apt-get install musl -y --no-install-recommends musl musl-dev musl-tools
    - go get ./...
    - go vet ./...
    - build/build-gcc.sh
    - build/build-musl.sh
    - go test -cover ./...
  when:
    branch: master

- name: buildrelease
  image: golang
  commands:
    - apt-get update && apt-get install musl -y --no-install-recommends musl musl-dev musl-tools
    - go get ./...
    - build/build-gcc.sh
    - build/build-musl.sh
  when:
    event: tag