forked from nervosnetwork/ckb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
102 lines (98 loc) · 3.65 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
trigger:
branches:
include:
- '*'
tags:
include:
- '*'
variables:
CKBClientVersion: v0.19.0
jobs:
- job: UnitTest
condition: |
and(
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')),
or(
eq(variables['Build.Reason'], 'PullRequest'),
eq(variables['Build.SourceBranch'], 'refs/heads/master')
)
)
pool:
vmImage: 'VS2017-Win2016'
steps:
- template: devtools/azure/windows-dependencies.yml
parameters:
rustup_toolchain: '1.36.0-x86_64-pc-windows-msvc'
- script: make test
displayName: Run unit tests
env:
CI: true
- job: IntegrationTest
condition: |
and(
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')),
ne(variables['Build.Reason'], 'PullRequest'),
or(
startsWith(variables['Build.SourceBranch'], 'refs/heads/rc/'),
in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/develop')
)
)
pool:
vmImage: 'VS2017-Win2016'
steps:
- template: devtools/azure/windows-dependencies.yml
parameters:
rustup_toolchain: '1.36.0-x86_64-pc-windows-msvc'
- script: make integration-windows
displayName: Run integration tests
env:
CI: true
- job: Package
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
pool:
vmImage: 'VS2017-Win2016'
steps:
- template: devtools/azure/windows-dependencies.yml
parameters:
rustup_toolchain: '1.36.0-x86_64-pc-windows-msvc'
- script: make prod
displayName: Build
- script: |
curl -LO https://github.com/nervosnetwork/ckb-cli/releases/download/$(CKBClientVersion)/ckb-cli_$(CKBClientVersion)_x86_64-pc-windows-msvc.zip
displayName: Download ckb-cli
- powershell: |
mkdir ckb_$(Build.SourceBranchName)_x86_64-pc-windows-msvc
cp -r target/release/ckb.exe,README.md,CHANGELOG.md,COPYING,docs ckb_$(Build.SourceBranchName)_x86_64-pc-windows-msvc
cp rpc/README.md ckb_$(Build.SourceBranchName)_x86_64-pc-windows-msvc/docs/rpc.md
unzip ckb-cli_$(CKBClientVersion)_x86_64-pc-windows-msvc.zip
mv ckb-cli_$(CKBClientVersion)_x86_64-pc-windows-msvc/ckb-cli.exe ckb_$(Build.SourceBranchName)_x86_64-pc-windows-msvc/
displayName: Prepare archive
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'ckb_$(Build.SourceBranchName)_x86_64-pc-windows-msvc'
archiveFile: '$(Build.ArtifactStagingDirectory)/ckb_$(Build.SourceBranchName)_x86_64-pc-windows-msvc.zip'
- script: choco install -y gpg4win
displayName: Install GPG4Win
- task: DownloadSecureFile@1
inputs:
secureFile: azure-secret.asc
- script: |
set PATH=%PATH%;%ProgramFiles(x86)%/GnuPG/bin
gpg --import %DOWNLOADSECUREFILE_SECUREFILEPATH%
echo "##vso[task.setvariable variable=PATH;]%PATH%;%ProgramFiles(x86)%/GnuPG/bin"
displayName: Setup GPG
- script: |
gpg -u "Nervos Azure Builder <[email protected]>" -ab "$(Build.ArtifactStagingDirectory)/ckb_$(Build.SourceBranchName)_x86_64-pc-windows-msvc.zip"
displayName: Sign Archive
- task: GitHubRelease@0
inputs:
gitHubConnection: nervos-bot
repositoryName: nervosnetwork/ckb
action: edit
tag: $(Build.SourceBranchName)
assets: |
$(Build.ArtifactStagingDirectory)/*.zip
$(Build.ArtifactStagingDirectory)/*.asc
assetUploadMode: replace
isPreRelease: true
addChangeLog: false