forked from artisanofcode-archive/terraform-provider-drone
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.drone.yml
58 lines (55 loc) · 2.04 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
kind: pipeline
name: default
steps:
- name: test
image: golang:1.12.1-alpine3.9
environment:
TF_ACC: 1
GO111MODULE: on
CGO_ENABLED: 0
DRONE_SERVER:
from_secret: DRONE_SERVER
DRONE_TOKEN:
from_secret: DRONE_TOKEN
DRONE_USER:
from_secret: DRONE_USER
commands:
- export PATH=$PATH:/go
- ls -al
- go test -mod=vendor -v ./...
when:
event:
- pull_request
- push
branch: master
- name: build
image: golang:1.12.1-alpine3.9
environment:
GO111MODULE: on
commands:
- export PATH=$PATH:/go
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/linux_amd64/terraform-provider-drone_${DRONE_TAG} -mod=vendor
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/linux_arm64/terraform-provider-drone_${DRONE_TAG} -mod=vendor
- CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o dist/linux_arm/terraform-provider-drone_${DRONE_TAG} -mod=vendor
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o dist/windows_amd64/terraform-provider-drone_${DRONE_TAG} -mod=vendor
- CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/darwin_amd64/terraform-provider-drone_${DRONE_TAG} -mod=vendor
- tar -cvzf dist/terraform-provider-drone_linux_amd64.tar.gz -C dist/linux_amd64 terraform-provider-drone_${DRONE_TAG}
- tar -cvzf dist/terraform-provider-drone_linux_arm64.tar.gz -C dist/linux_arm64 terraform-provider-drone_${DRONE_TAG}
- tar -cvzf dist/terraform-provider-drone_linux_arm.tar.gz -C dist/linux_arm terraform-provider-drone_${DRONE_TAG}
- tar -cvzf dist/terraform-provider-drone_windows_amd64.tar.gz -C dist/windows_amd64 terraform-provider-drone_${DRONE_TAG}
- tar -cvzf dist/terraform-provider-drone_darwin_amd64.tar.gz -C dist/darwin_amd64 terraform-provider-drone_${DRONE_TAG}
when:
event: tag
- name: release
image: plugins/github-release
settings:
checksum:
- md5
- sha1
- sha256
- sha512
api_key:
from_secret: GITHUB_TOKEN
files: dist/*.tar.gz
when:
event: tag