go-check-plugins-artifacts/.drone.yml

78 lines
1.6 KiB
YAML
Raw Normal View History

2020-05-21 21:12:02 +02:00
---
kind: pipeline
type: docker
2020-05-21 21:27:58 +02:00
name: default
2020-05-21 21:12:02 +02:00
clone:
disable: true
steps:
- name: clone
image: alpine/git
commands:
2020-05-21 21:18:13 +02:00
- git clone https://github.com/mackerelio/go-check-plugins.git .
2020-05-21 21:34:27 +02:00
- git checkout $DRONE_TAG
2020-05-21 21:27:58 +02:00
when:
event: tag
- name: create_dir
image: alpine
commands:
- mkdir build
when:
event: tag
2020-05-21 21:28:39 +02:00
- name: build-linux-amd64
2020-05-21 21:12:02 +02:00
image: golang
commands:
2020-05-21 21:27:58 +02:00
- go build -o build/go-check-plugins-$DRONE_TAG-$GOOS-$GOARCH
2020-05-21 21:12:02 +02:00
environment:
GOOS: linux
GOARCH: amd64
2020-05-21 21:27:58 +02:00
when:
event: tag
2020-05-21 21:28:39 +02:00
- name: build-linux-arm64
2020-05-21 21:27:58 +02:00
image: golang
commands:
- go build -o build/go-check-plugins-$DRONE_TAG-$GOOS-$GOARCH
environment:
GOOS: linux
GOARCH: arm64
when:
event: tag
2020-05-21 21:28:39 +02:00
- name: build-linux-arm
2020-05-21 21:27:58 +02:00
image: golang
commands:
- go build -o build/go-check-plugins-$DRONE_TAG-$GOOS-$GOARCH
environment:
GOOS: linux
GOARCH: arm
when:
event: tag
2020-05-21 21:28:39 +02:00
- name: build-netbsd-amd64
2020-05-21 21:27:58 +02:00
image: golang
commands:
- go build -o build/go-check-plugins-$DRONE_TAG-$GOOS-$GOARCH
environment:
GOOS: netbsd
GOARCH: amd64
when:
event: tag
- name: create_archive
image: alpine
commands:
- cd build
- tar -czvf go-check-plugins-$DRONE_TAG.tar.gz *
when:
event: tag
2020-05-21 21:12:02 +02:00
- name: release
image: plugins/gitea-release
settings:
base_url: https://git.paulbsd.com
api_key:
from_secret: gitea_token
2020-05-21 21:34:27 +02:00
files: "build/*.tar.gz"
2020-05-21 21:12:02 +02:00
checksum:
- sha256
- sha512
when:
event: tag