azure-pipelines.yml 2.6 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. 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
  60. displayName: Apt Install
  61. - script: |
  62. go version
  63. unset GOPATH
  64. mkdir ./src/v2ray.com
  65. ln -s ../triggersrc ./src/v2ray.com/core
  66. go get -v -t -d v2ray.com/core/...
  67. workingDirectory: '$(GOPATH)'
  68. displayName: 'Fetch sources'
  69. - script: |
  70. mkdir release
  71. cd src
  72. zip -9 -r ../release/src_all.zip * -x '*.git*'
  73. workingDirectory: '$(GOPATH)'
  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: '$(GOPATH)'
  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: '$(GOPATH)'
  85. displayName: 'Build Binaries'
  86. - script: |
  87. cp ./src/v2ray.com/core/bazel-bin/release/*.zip ./release/
  88. workingDirectory: '$(GOPATH)'
  89. displayName: 'Dump Binaries'