You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.5 KiB

trigger:
batch: true
branches:
include:
- master
6 years ago
- dev*
- refs/tags/*
6 years ago
pr:
- master
- dev*
jobs:
- template: azure-pipelines.template.yml
parameters:
name: linux
vmImage: 'ubuntu-16.04'
- template: azure-pipelines.template.yml
parameters:
name: windows
vmImage: 'vs2017-win2016'
- template: azure-pipelines.template.yml
parameters:
name: macos
vmImage: 'macOS-10.14'
- job: linux_coverage
dependsOn: linux
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
timeoutInMinutes: 30
pool:
vmImage: 'Ubuntu 16.04'
6 years ago
#variables:
# CODECOV_TOKEN: '$(coverage.token)'
6 years ago
steps:
- checkout: self
- task: GoTool@0
inputs:
version: '1.13'
- 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 16.04'
6 years ago
variables:
6 years ago
- group: GithubToken
- name: GOPATH
value: '$(system.defaultWorkingDirectory)/gopath'
- name: BAZEL_VER
value: '0.23.0'
steps:
6 years ago
- checkout: self
- task: GoTool@0
inputs:
version: '1.13'
6 years ago
- script: |
mkdir triggersrc
6 years ago
ls -I "triggersrc" | xargs cp -rf -t triggersrc
6 years ago
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
6 years ago
ln -s $(pwd)/../triggersrc ./src/v2ray.com/core
go get -v -t -d ./src/v2ray.com/core/...
tree
6 years ago
workingDirectory: '$(GOPATH)'
displayName: 'Fetch sources'
- script: |
mkdir release
cd src
zip -9 -r ../release/src_all.zip * -x '*.git*'
6 years ago
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
6 years ago
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
6 years ago
workingDirectory: '$(GOPATH)'
displayName: 'Build Binaries'
- script: |
cp ./src/v2ray.com/core/bazel-bin/release/*.zip ./release/
6 years ago
workingDirectory: '$(GOPATH)'
displayName: 'Dump Binaries'
- script: |
6 years ago
cd ./src/v2ray.com/core
6 years ago
echo $RELEASE_TAG
./release/bleedingrelease.sh
workingDirectory: '$(GOPATH)'
displayName: 'Generate Bleeding Edge Release'
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
PRERELEASE: true
6 years ago
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)