azure-pipelines.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. steps:
  32. - checkout: self
  33. - task: GoTool@0
  34. inputs:
  35. version: '1.12'
  36. - script: |
  37. bash ./testing/coverage/coverall
  38. workingDirectory: '$(Build.SourcesDirectory)'
  39. displayName: 'Coverage'
  40. - job: make_release
  41. dependsOn: linux
  42. condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
  43. timeoutInMinutes: 60
  44. pool:
  45. vmImage: 'Ubuntu 16.04'
  46. variables:
  47. - group: GithubToken
  48. - name: GOPATH
  49. value: '$(system.defaultWorkingDirectory)/gopath'
  50. - name: BAZEL_VER
  51. value: '0.23.0'
  52. steps:
  53. - checkout: self
  54. - task: GoTool@0
  55. inputs:
  56. version: '1.12'
  57. - script: |
  58. mkdir triggersrc
  59. ls -I "triggersrc" | xargs cp -rf -t triggersrc
  60. mkdir gopath
  61. displayName: Prepare Environment
  62. workingDirectory: '$(system.defaultWorkingDirectory)'
  63. - script: |
  64. sudo apt-get -y update
  65. sudo apt-get -y install jq git file pkg-config zip g++ zlib1g-dev unzip python openssl tree
  66. displayName: Apt Install
  67. - script: |
  68. go version
  69. unset GOPATH
  70. mkdir ./src
  71. mkdir ./src/v2ray.com
  72. ln -s $(pwd)/../triggersrc ./src/v2ray.com/core
  73. go get -v -t -d ./src/v2ray.com/core/...
  74. tree
  75. workingDirectory: '$(GOPATH)'
  76. displayName: 'Fetch sources'
  77. - script: |
  78. mkdir release
  79. cd src
  80. zip -9 -r ../release/src_all.zip * -x '*.git*'
  81. workingDirectory: '$(GOPATH)'
  82. displayName: 'Dump sources'
  83. - script: |
  84. curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VER}/bazel-${BAZEL_VER}-installer-linux-x86_64.sh
  85. chmod +x bazel-installer.sh
  86. ./bazel-installer.sh --user
  87. workingDirectory: '$(GOPATH)'
  88. displayName: 'Install Bazel'
  89. - script: |
  90. cd ./src/v2ray.com/core
  91. ./release/updatedat.sh
  92. $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
  93. workingDirectory: '$(GOPATH)'
  94. displayName: 'Build Binaries'
  95. - script: |
  96. cp ./src/v2ray.com/core/bazel-bin/release/*.zip ./release/
  97. workingDirectory: '$(GOPATH)'
  98. displayName: 'Dump Binaries'
  99. - script: |
  100. cd ./src/v2ray.com/core
  101. echo $RELEASE_TAG
  102. ./release/bleedingrelease.sh
  103. workingDirectory: '$(GOPATH)'
  104. displayName: 'Generate Bleeding Edge Release'
  105. env:
  106. GITHUB_TOKEN: $(GITHUB_TOKEN)
  107. PRERELEASE: true
  108. RELEASE_TAG: unstable-$(Build.SourceVersion)