azure-pipelines.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Go
  2. # Build your Go project.
  3. # Add steps that test, save build artifacts, deploy, and more:
  4. # https://docs.microsoft.com/azure/devops/pipelines/languages/go
  5. pool:
  6. vmImage: 'Ubuntu 16.04'
  7. variables:
  8. GOBIN: '$(GOPATH)/bin' # Go binaries path
  9. GOROOT: '/usr/local/go1.11' # Go installation path
  10. GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
  11. modulePath: '$(GOPATH)/src/v2ray.com/core' # Path to the module's code
  12. steps:
  13. - script: |
  14. mkdir -p '$(GOBIN)'
  15. mkdir -p '$(GOPATH)/pkg'
  16. mkdir -p '$(modulePath)'
  17. shopt -s extglob
  18. mv !(gopath) '$(modulePath)'
  19. echo '##vso[task.prependpath]$(GOBIN)'
  20. echo '##vso[task.prependpath]$(GOROOT)/bin'
  21. displayName: 'Set up the Go workspace'
  22. - script: |
  23. go version
  24. go get -v -t -d ./...
  25. if [ -f Gopkg.toml ]; then
  26. curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
  27. dep ensure
  28. fi
  29. go build -v .
  30. workingDirectory: '$(modulePath)'
  31. displayName: 'Get dependencies, then build'