azure-pipelines.yml 3.0 KB

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