-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
59 lines (57 loc) · 1.81 KB
/
azure-pipelines.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
variables:
GOPATH: "$(system.defaultWorkingDirectory)/gopath"
GO111MODULE: "on"
MODULEPATH: "$(GOPATH)/src/github.com/$(build.repository.name)"
PKG: $(Build.DefinitionName)
VER: $(Build.SourceBranchName)
PLAT: $(System.Phasename)
BT_API: https://api.bintray.com/content
BT_REPO: public-bin
BT_OPTS: publish=1&override=1
BT_URL: $(BT_API)/$(BT_USER)/$(BT_REPO)/$(PKG)/$(VER)/$(PLAT)/$(FILE)?$(BT_OPTS)
LD_FLAGS: "-s -w -X main.Version=$(VER)"
trigger:
branches:
include: ['*']
tags:
include: ['*']
jobs:
- job: windows_x64
variables:
FILE: $(PKG).exe
pool:
vmImage: "vs2017-win2016"
steps:
- script: go test ./...
displayName: go_test
- script: go build -o $(FILE) -ldflags="$(LD_FLAGS)"
displayName: go_build
- script: curl -T $(FILE) -u$(BT_USER):$(BT_KEY) "$(BT_URL)"
displayName: bintray_publish
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
- job: macos_x64
variables:
FILE: $(PKG)
pool:
vmImage: "macOS-10.13"
steps:
- script: go test ./...
displayName: go_test
- script: go build -o $(FILE) -ldflags="$(LD_FLAGS)"
displayName: go_build
- script: curl -T $(FILE) -u$(BT_USER):$(BT_KEY) "$(BT_URL)"
displayName: bintray_publish
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
- job: linux_x64
variables:
FILE: $(PKG)
pool:
vmImage: "ubuntu-16.04"
steps:
- script: go test ./...
displayName: go_test
- script: go build -o $(FILE) -ldflags="$(LD_FLAGS)"
displayName: go_build
- script: curl -T $(FILE) -u$(BT_USER):$(BT_KEY) "$(BT_URL)"
displayName: bintray_publish
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')