azure-pipelines.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. trigger:
  2. batch: true
  3. branches:
  4. include:
  5. - master
  6. pr: none
  7. jobs:
  8. - template: azure-pipelines.template.yml
  9. parameters:
  10. name: linux
  11. vmImage: 'ubuntu-16.04'
  12. - template: azure-pipelines.template.yml
  13. parameters:
  14. name: windows
  15. vmImage: 'vs2017-win2016'
  16. - template: azure-pipelines.template.yml
  17. parameters:
  18. name: macos
  19. vmImage: 'macOS-10.13'
  20. - job: linux_coverage
  21. dependsOn: linux
  22. condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
  23. timeoutInMinutes: 30
  24. pool:
  25. vmImage: 'Ubuntu 16.04'
  26. variables:
  27. CODECOV_TOKEN: '$(coverage.token)'
  28. steps:
  29. - checkout: self
  30. - task: GoTool@0
  31. inputs:
  32. version: '1.12'
  33. - script: |
  34. bash ./testing/coverage/coverall
  35. workingDirectory: '$(Build.SourcesDirectory)'
  36. displayName: 'Coverage'
  37. - job: make_release
  38. dependsOn: linux
  39. condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
  40. timeoutInMinutes: 60
  41. pool:
  42. vmImage: 'Ubuntu 16.04'
  43. variables:
  44. GOPATH: '$(system.defaultWorkingDirectory)/gopath'
  45. BAZEL_VER: '0.23.0'
  46. steps:
  47. - checkout: self
  48. - task: GoTool@0
  49. inputs:
  50. version: '1.12'
  51. - script: |
  52. mkdir triggersrc
  53. ls -I "triggersrc" | xargs cp -rf -t triggersrc
  54. mkdir gopath
  55. displayName: Prepare Environment
  56. workingDirectory: '$(system.defaultWorkingDirectory)'
  57. - script: |
  58. sudo apt-get -y update
  59. sudo apt-get -y install jq git file pkg-config zip g++ zlib1g-dev unzip python openssl tree
  60. displayName: Apt Install
  61. - script: |
  62. go version
  63. unset GOPATH
  64. mkdir ./src
  65. mkdir ./src/v2ray.com
  66. ln -s $(pwd)/../triggersrc ./src/v2ray.com/core
  67. go get -v -t -d ./src/v2ray.com/core/...
  68. tree
  69. workingDirectory: '$(GOPATH)'
  70. displayName: 'Fetch sources'
  71. - script: |
  72. mkdir release
  73. cd src
  74. zip -9 -r ../release/src_all.zip * -x '*.git*'
  75. workingDirectory: '$(GOPATH)'
  76. displayName: 'Dump sources'
  77. - script: |
  78. curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VER}/bazel-${BAZEL_VER}-installer-linux-x86_64.sh
  79. chmod +x bazel-installer.sh
  80. ./bazel-installer.sh --user
  81. workingDirectory: '$(GOPATH)'
  82. displayName: 'Install Bazel'
  83. - script: |
  84. cd ./src/v2ray.com/core
  85. $HOME/bin/bazel build --action_env=GOPATH=$GOPATH --action_env=PATH=$PATH --action_env=GPG_PASS=${SIGN_KEY_PASS} --action_env=SPWD=$PWD --action_env=GOCACHE=$(go env GOCACHE) --spawn_strategy local //release:all
  86. workingDirectory: '$(GOPATH)'
  87. displayName: 'Build Binaries'
  88. - script: |
  89. cp ./src/v2ray.com/core/bazel-bin/release/*.zip ./release/
  90. workingDirectory: '$(GOPATH)'
  91. displayName: 'Dump Binaries'