azure-pipelines.yml 2.7 KB

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