azure-pipelines.yml 3.6 KB

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