forked from arduino/arduino-create-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
61 lines (61 loc) · 2.36 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
build:
crosscompilation:
image: arduino/golang-cross
auth_config:
username: $$DOCKER_USERNAME
password: $$DOCKER_PASSWORD
email: $$DOCKER_EMAIL
commands:
- go get github.com/kardianos/govendor
- govendor vet +local
- govendor test +local
# Linux amd64
- GOOS=linux GOARCH=amd64 CC=gcc CXX=gcc CGO_ENABLED=1 go build -o artifacts/linux-amd64/arduino-create-agent
- cp config.ini artifacts/linux-amd64
# Darwin amd64
- GOOS=darwin GOARCH=amd64 CC=o64-clang CXX=o64-clang CGO_ENABLED=1 go build -o artifacts/osx/arduino-create-agent
- cp config.ini artifacts/osx
# Windows 386
- GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-gcc CGO_ENABLED=1 go build -o artifacts/windows/arduino-create-agent.exe -ldflags -H=windowsgui
- cp config.ini artifacts/windows
- zip -r arduino-create-agent.zip artifacts/*
linux32:
image: arduino/golang-linux-32
commands:
- GOOS=linux GOARCH=386 CC=gcc CXX=gcc CGO_ENABLED=1 go build -o artifacts/linux-386/arduino-create-agent
- cp config.ini artifacts/linux-386
notify:
slack:
webhook_url: $$SLACK_WEBHOOK
channel: $$SLACK_CHANNEL
username: drone
when:
event: pull_request
template: |
{{#success build.status}}
[{{ repo.name}}] Congrats {{ build.author }}! Your PR works: {{ build.link_url}}
{{else}}
[{{ repo.name}}] Damn {{ build.author }}! Something went wrong with your PR: {{ build.link_url}}
{{/success}}
publish:
github_release:
api_key: $$GITHUB_API_KEY
files:
- arduino-create-agent.zip
checksum:
- md5
when:
event: tag
notify:
slack:
webhook_url: $$SLACK_WEBHOOK
channel: $$SLACK_CHANNEL
username: drone
when:
event: tag
template: |
{{#success build.status}}
[{{ repo.name}}/{{ build.branch }}] A new release is available: {{ build.link_url}}
{{else}}
[{{ repo.name}}/{{ build.branch }}] Something went wrong while building a new release: {{ build.link_url}}
{{/success}}