-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
39 lines (33 loc) · 1019 Bytes
/
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
# Go
# Build your Go project.
# Add steps that test, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/go
# Template requirements: *.go and go.mod files in directory
trigger:
- main
pool:
vmImage: ubuntu-latest
variables:
GOBIN: '$(system.defaultWorkingDirectory)/bin' # Go binaries path
steps:
- script: |
mkdir -p '$(GOBIN)'
echo '##vso[task.prependpath]$(GOBIN)'
displayName: 'Set up the Go workspace'
- script: |
ls -la $(system.defaultWorkingDirectory)
displayName: 'List files in the working directory'
- script: |
go version
if [ ! -f go.mod ]; then
go mod init example.com/myproject # replace with your module path
fi
go mod tidy
go mod download
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
go build -v .
workingDirectory: '$(system.defaultWorkingDirectory)'
displayName: 'Get dependencies, then build'