azure-pipelines.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.13'
  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)'
  45. BAZEL_VER: '0.23.0'
  46. steps:
  47. - checkout: none
  48. - task: GoTool@0
  49. inputs:
  50. version: '1.13'
  51. - script: |
  52. sudo apt-get -y update
  53. sudo apt-get -y install jq git file pkg-config zip g++ zlib1g-dev unzip python openssl
  54. displayName: Apt Install
  55. - script: |
  56. go version
  57. go get -insecure -v -t -d v2ray.com/core/...
  58. workingDirectory: '$(system.defaultWorkingDirectory)'
  59. displayName: 'Fetch sources'
  60. - script: |
  61. mkdir release
  62. cd src
  63. zip -9 -r ../release/src_all.zip * -x '*.git*'
  64. workingDirectory: '$(system.defaultWorkingDirectory)'
  65. displayName: 'Dump sources'
  66. - script: |
  67. curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VER}/bazel-${BAZEL_VER}-installer-linux-x86_64.sh
  68. chmod +x bazel-installer.sh
  69. ./bazel-installer.sh --user
  70. workingDirectory: '$(system.defaultWorkingDirectory)'
  71. displayName: 'Install Bazel'
  72. - script: |
  73. cd ./src/v2ray.com/core
  74. $HOME/bin/bazel build --action_env=GOPATH=$GOPATH --action_env=PATH=$PATH --action_env=GPG_PASS=${SIGN_KEY_PASS} //release:all
  75. workingDirectory: '$(system.defaultWorkingDirectory)'
  76. displayName: 'Build Binaries'
  77. - script: |
  78. cp ./src/v2ray.com/core/bazel-bin/release/*.zip ./release/
  79. workingDirectory: '$(system.defaultWorkingDirectory)'
  80. displayName: 'Dump Binaries'