2019-02-06 17:25:58 -05:00
|
|
|
trigger:
|
|
|
|
batch: true
|
2019-02-06 17:28:18 -05:00
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
2019-04-15 23:23:47 -04:00
|
|
|
- dev*
|
2019-02-06 17:28:18 -05:00
|
|
|
|
2019-04-15 23:23:47 -04:00
|
|
|
pr:
|
|
|
|
- master
|
|
|
|
- dev*
|
2019-02-06 17:25:58 -05:00
|
|
|
|
2018-11-12 16:12:01 -05:00
|
|
|
jobs:
|
2018-11-12 16:37:44 -05:00
|
|
|
- template: azure-pipelines.template.yml
|
|
|
|
parameters:
|
|
|
|
name: linux
|
|
|
|
vmImage: 'ubuntu-16.04'
|
|
|
|
|
|
|
|
- template: azure-pipelines.template.yml
|
|
|
|
parameters:
|
|
|
|
name: windows
|
|
|
|
vmImage: 'vs2017-win2016'
|
2018-11-12 16:12:01 -05:00
|
|
|
|
2018-11-12 16:37:44 -05:00
|
|
|
- template: azure-pipelines.template.yml
|
|
|
|
parameters:
|
|
|
|
name: macos
|
|
|
|
vmImage: 'macOS-10.13'
|
2018-11-12 16:12:01 -05:00
|
|
|
|
2018-11-12 16:37:44 -05:00
|
|
|
- job: linux_coverage
|
|
|
|
dependsOn: linux
|
2018-11-12 17:58:26 -05:00
|
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
|
2018-11-12 16:37:44 -05:00
|
|
|
timeoutInMinutes: 30
|
2018-11-12 16:28:13 -05:00
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'Ubuntu 16.04'
|
|
|
|
|
2019-04-16 03:00:26 -04:00
|
|
|
#variables:
|
|
|
|
# CODECOV_TOKEN: '$(coverage.token)'
|
2019-04-16 02:50:20 -04:00
|
|
|
|
2018-11-12 16:28:13 -05:00
|
|
|
|
|
|
|
steps:
|
2019-02-13 05:06:39 -05:00
|
|
|
- checkout: self
|
2019-02-06 17:25:58 -05:00
|
|
|
- task: GoTool@0
|
|
|
|
inputs:
|
2019-02-26 04:19:36 -05:00
|
|
|
version: '1.12'
|
2018-11-12 16:28:13 -05:00
|
|
|
- script: |
|
|
|
|
bash ./testing/coverage/coverall
|
2019-02-13 05:06:39 -05:00
|
|
|
workingDirectory: '$(Build.SourcesDirectory)'
|
2018-11-12 16:28:13 -05:00
|
|
|
displayName: 'Coverage'
|
2019-02-06 17:25:58 -05:00
|
|
|
|
|
|
|
- job: make_release
|
|
|
|
dependsOn: linux
|
|
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
|
|
|
|
timeoutInMinutes: 60
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'Ubuntu 16.04'
|
2019-04-15 06:39:47 -04:00
|
|
|
|
2019-02-06 17:25:58 -05:00
|
|
|
variables:
|
2019-04-16 04:46:37 -04:00
|
|
|
- group: GithubToken
|
|
|
|
- name: GOPATH
|
|
|
|
value: '$(system.defaultWorkingDirectory)/gopath'
|
|
|
|
- name: BAZEL_VER
|
|
|
|
value: '0.23.0'
|
2019-02-06 17:25:58 -05:00
|
|
|
|
|
|
|
steps:
|
2019-04-15 06:39:47 -04:00
|
|
|
- checkout: self
|
2019-02-06 17:25:58 -05:00
|
|
|
- task: GoTool@0
|
|
|
|
inputs:
|
2019-02-26 04:19:36 -05:00
|
|
|
version: '1.12'
|
2019-04-15 06:39:47 -04:00
|
|
|
- script: |
|
2019-04-15 07:00:53 -04:00
|
|
|
mkdir triggersrc
|
2019-04-15 07:30:40 -04:00
|
|
|
ls -I "triggersrc" | xargs cp -rf -t triggersrc
|
2019-04-15 06:39:47 -04:00
|
|
|
mkdir gopath
|
|
|
|
displayName: Prepare Environment
|
|
|
|
workingDirectory: '$(system.defaultWorkingDirectory)'
|
2019-02-07 06:38:44 -05:00
|
|
|
- script: |
|
|
|
|
sudo apt-get -y update
|
2019-04-15 08:33:30 -04:00
|
|
|
sudo apt-get -y install jq git file pkg-config zip g++ zlib1g-dev unzip python openssl tree
|
2019-02-07 06:38:44 -05:00
|
|
|
displayName: Apt Install
|
2019-02-06 17:25:58 -05:00
|
|
|
- script: |
|
|
|
|
go version
|
2019-04-15 07:12:43 -04:00
|
|
|
unset GOPATH
|
2019-04-15 07:49:49 -04:00
|
|
|
mkdir ./src
|
2019-04-15 07:23:28 -04:00
|
|
|
mkdir ./src/v2ray.com
|
2019-04-15 08:48:52 -04:00
|
|
|
ln -s $(pwd)/../triggersrc ./src/v2ray.com/core
|
2019-04-15 07:51:47 -04:00
|
|
|
go get -v -t -d ./src/v2ray.com/core/...
|
2019-04-15 08:33:30 -04:00
|
|
|
tree
|
2019-04-15 06:39:47 -04:00
|
|
|
workingDirectory: '$(GOPATH)'
|
2019-02-06 17:25:58 -05:00
|
|
|
displayName: 'Fetch sources'
|
2019-02-07 06:38:44 -05:00
|
|
|
- script: |
|
|
|
|
mkdir release
|
|
|
|
cd src
|
|
|
|
zip -9 -r ../release/src_all.zip * -x '*.git*'
|
2019-04-15 06:39:47 -04:00
|
|
|
workingDirectory: '$(GOPATH)'
|
2019-02-07 06:38:44 -05:00
|
|
|
displayName: 'Dump sources'
|
2019-02-06 17:25:58 -05:00
|
|
|
- script: |
|
2019-02-07 03:10:52 -05:00
|
|
|
curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VER}/bazel-${BAZEL_VER}-installer-linux-x86_64.sh
|
|
|
|
chmod +x bazel-installer.sh
|
|
|
|
./bazel-installer.sh --user
|
2019-04-15 06:39:47 -04:00
|
|
|
workingDirectory: '$(GOPATH)'
|
2019-02-06 17:25:58 -05:00
|
|
|
displayName: 'Install Bazel'
|
|
|
|
- script: |
|
|
|
|
cd ./src/v2ray.com/core
|
2019-04-16 08:24:15 -04:00
|
|
|
./release/updatedat.sh
|
2019-04-15 21:36:36 -04:00
|
|
|
$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
|
2019-04-15 06:39:47 -04:00
|
|
|
workingDirectory: '$(GOPATH)'
|
2019-02-06 17:25:58 -05:00
|
|
|
displayName: 'Build Binaries'
|
2019-02-07 06:38:44 -05:00
|
|
|
- script: |
|
|
|
|
cp ./src/v2ray.com/core/bazel-bin/release/*.zip ./release/
|
2019-04-15 06:39:47 -04:00
|
|
|
workingDirectory: '$(GOPATH)'
|
2019-02-07 06:38:44 -05:00
|
|
|
displayName: 'Dump Binaries'
|
2019-04-16 00:26:36 -04:00
|
|
|
- script: |
|
2019-04-16 03:30:14 -04:00
|
|
|
cd ./src/v2ray.com/core
|
2019-04-16 04:09:08 -04:00
|
|
|
echo $RELEASE_TAG
|
2019-04-16 00:26:36 -04:00
|
|
|
./release/bleedingrelease.sh
|
|
|
|
workingDirectory: '$(GOPATH)'
|
|
|
|
displayName: 'Generate Bleeding Edge Release'
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: $(GITHUB_TOKEN)
|
|
|
|
PRERELEASE: true
|
2019-04-16 06:45:36 -04:00
|
|
|
RELEASE_TAG: unstable-$(Build.SourceVersion)
|