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