azure-pipelines.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. GOPATH: '$(system.defaultWorkingDirectory)'
  28. CODECOV_TOKEN: '$(coverage.token)'
  29. steps:
  30. - checkout: none
  31. - task: GoTool@0
  32. inputs:
  33. version: '1.11.5'
  34. - script: |
  35. go version
  36. go get -v -t -d v2ray.com/core/...
  37. workingDirectory: '$(system.defaultWorkingDirectory)'
  38. displayName: 'Fetch sources'
  39. - script: |
  40. cd ./src/v2ray.com/core
  41. bash ./testing/coverage/coverall
  42. workingDirectory: '$(system.defaultWorkingDirectory)'
  43. displayName: 'Coverage'
  44. - job: make_release
  45. dependsOn: linux
  46. condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
  47. timeoutInMinutes: 60
  48. pool:
  49. vmImage: 'Ubuntu 16.04'
  50. variables:
  51. GOPATH: '$(system.defaultWorkingDirectory)'
  52. BAZEL_VER: '0.22.0'
  53. steps:
  54. - checkout: none
  55. - task: GoTool@0
  56. inputs:
  57. version: '1.11.5'
  58. - script: |
  59. sudo apt-get -y update
  60. sudo apt-get -y install jq git file pkg-config zip g++ zlib1g-dev unzip python openssl
  61. displayName: Apt Install
  62. - script: |
  63. go version
  64. go get -v -t -d v2ray.com/core/...
  65. workingDirectory: '$(system.defaultWorkingDirectory)'
  66. displayName: 'Fetch sources'
  67. - script: |
  68. mkdir release
  69. cd src
  70. zip -9 -r ../release/src_all.zip * -x '*.git*'
  71. workingDirectory: '$(system.defaultWorkingDirectory)'
  72. displayName: 'Dump sources'
  73. - script: |
  74. curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VER}/bazel-${BAZEL_VER}-installer-linux-x86_64.sh
  75. chmod +x bazel-installer.sh
  76. ./bazel-installer.sh --user
  77. workingDirectory: '$(system.defaultWorkingDirectory)'
  78. displayName: 'Install Bazel'
  79. - script: |
  80. cd ./src/v2ray.com/core
  81. $HOME/bin/bazel build --action_env=GOPATH=$GOPATH --action_env=PATH=$PATH --action_env=GPG_PASS=${SIGN_KEY_PASS} //release:all
  82. workingDirectory: '$(system.defaultWorkingDirectory)'
  83. displayName: 'Build Binaries'
  84. - script: |
  85. cp ./src/v2ray.com/core/bazel-bin/release/*.zip ./release/
  86. workingDirectory: '$(system.defaultWorkingDirectory)'
  87. displayName: 'Dump Binaries'