forked from harness/drone-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
63 lines (54 loc) · 2.37 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
59
60
61
62
63
image: library/golang:1.4.1-cross
git:
path: github.com/drone/drone-cli
env:
- GOROOT=/usr/src/go
- PATH=$PATH:$GOROOT/bin:$GOPATH/bin
script:
- go get ./...
- go test ./...
# compile drone for all architectures
- GOOS=linux GOARCH=amd64 go build -o ./bin/linux/amd64/drone github.com/drone/drone-cli/drone
- GOOS=linux GOARCH=386 go build -o ./bin/linux/386/drone github.com/drone/drone-cli/drone
- GOOS=linux GOARCH=arm go build -o ./bin/linux/arm/drone github.com/drone/drone-cli/drone
- GOOS=darwin GOARCH=amd64 go build -o ./bin/darwin/amd64/drone github.com/drone/drone-cli/drone
- GOOS=windows GOARCH=386 go build -o ./bin/windows/386/drone github.com/drone/drone-cli/drone
- GOOS=windows GOARCH=amd64 go build -o ./bin/windows/amd64/drone github.com/drone/drone-cli/drone
# tar binary files prior to upload
- mkdir ./dist
- tar -cvzf ./dist/drone_linux_amd64.tar.gz ./bin/linux/amd64/drone
- tar -cvzf ./dist/drone_linux_386.tar.gz ./bin/linux/386/drone
- tar -cvzf ./dist/drone_linux_arm.tar.gz ./bin/linux/arm/drone
- tar -cvzf ./dist/drone_darwin_amd64.tar.gz ./bin/darwin/amd64/drone
- tar -cvzf ./dist/drone_windows_386.tar.gz ./bin/windows/386/drone
- tar -cvzf ./dist/drone_windows_amd64.tar.gz ./bin/windows/amd64/drone
# generate shas for tar files
- sha256sum ./dist/drone_linux_amd64.tar.gz > ./dist/drone_linux_amd64.sha256
- sha256sum ./dist/drone_linux_386.tar.gz > ./dist/drone_linux_386.sha256
- sha256sum ./dist/drone_linux_arm.tar.gz > ./dist/drone_linux_arm.sha256
- sha256sum ./dist/drone_darwin_amd64.tar.gz > ./dist/drone_darwin_amd64.sha256
- sha256sum ./dist/drone_windows_386.tar.gz > ./dist/drone_windows_386.sha256
- sha256sum ./dist/drone_windows_amd64.tar.gz > ./dist/drone_windows_amd64.sha256
# install pip (required by s3 plugin to instal s3 cli)
- apt-get update 1> /dev/null 2> /dev/null
- apt-get -y install python-pip 1> /dev/null 2> /dev/null
publish:
s3:
acl: public-read
region: us-east-1
bucket: downloads.drone.io
access_key: $$AWS_KEY
secret_key: $$AWS_SECRET
source: dist/
target: drone-cli/
recursive: true
when:
branch: master
owner: drone
notify:
webhook:
urls:
- https://webhooks.gitter.im/e/$$GITTER_KEY
on_started: false
on_success: true
on_failure: true