This repository has been archived by the owner on Apr 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines.yml
132 lines (129 loc) · 5.27 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:
branches:
include:
- master
- dev
pr:
branches:
include:
- master
- dev
variables:
solution: 'IntifaceCLI.sln'
buildPlatform: 'Any CPU'
jobs:
- job: Windows
pool:
vmImage: 'windows-latest'
strategy:
matrix:
# Debug:
# buildConfiguration: Debug
Release:
buildConfiguration: Release
steps:
- template: build/build-start.yml
parameters:
platform: "win-x64"
# Set up key after build start, otherwise we won't have nuget to update yet.
- template: build/setup-signing-key.yml
- task: VSBuild@1
displayName: "Build Project"
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
maximumCpuCount: true
- task: PowerShell@2
displayName: 'Sign CLI Executable in tree'
inputs:
targetType: inline
script: |
Set-Alias Signtool 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe'
Signtool sign /f SigningCert.pfx /p "$(NPLabsRepoSigningKey)" /td sha256 /tr http://timestamp.comodoca.com/rfc3161 $(System.DefaultWorkingDirectory)\IntifaceCLI\bin\$(buildConfiguration)\net47\IntifaceCLI.exe
- task: PowerShell@2
displayName: "Build CLI Installer"
inputs:
targetType: inline
script: |
$Env:CONFIGURATION = "$(buildConfiguration)"
$Env:BUILD_VERSION = "$(gitVersion)"
cinst -y --no-progress innosetup
ISCC intiface-cli-installer.iss
move installer\intiface-cli-installer.exe installer\$(cliBuildName)-installer.exe
- task: PowerShell@2
displayName: 'Sign CLI Installer'
inputs:
targetType: inline
script: |
Set-Alias Signtool 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe'
Signtool sign /f SigningCert.pfx /p "$(NPLabsRepoSigningKey)" /td sha256 /tr http://timestamp.comodoca.com/rfc3161 $(System.DefaultWorkingDirectory)\installer\$(cliBuildName)-installer.exe
- task: CopyFiles@2
displayName: "Copy installer to staging"
inputs:
contents: "$(System.DefaultWorkingDirectory)/installer/*.exe"
targetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: CopyFiles@2
displayName: "Copy bare program for Unity distribution"
condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'))
inputs:
contents: |
$(System.DefaultWorkingDirectory)/IntifaceCLI/bin/Release/net47/*.exe
$(System.DefaultWorkingDirectory)/IntifaceCLI/bin/Release/net47/*.dll
$(System.DefaultWorkingDirectory)/IntifaceCLI/bin/Release/net47/*.config
$(System.DefaultWorkingDirectory)/README.md
$(System.DefaultWorkingDirectory)/LICENSE
targetFolder: '$(Build.ArtifactStagingDirectory)/IntifaceCLIUnity'
flattenFolders: true
- task: ArchiveFiles@2
displayName: "Archive unity artifacts"
condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'))
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/IntifaceCLIUnity"
archiveType: "zip"
archiveFile: "$(Build.ArtifactStagingDirectory)/intiface-cli-unity-$(gitVersion).zip"
includeRootFolder: false
- task: PublishPipelineArtifact@0
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'win-x64-$(buildConfiguration)'
- job: Deploy
dependsOn:
- Windows
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
pool:
vmImage: 'vs2017-win2016'
steps:
- template: build/setup-variables.yml
- task: DownloadPipelineArtifact@1
displayName: Download Artifacts from other jobs
inputs:
buildType: 'current'
- task: GitHubRelease@0
displayName: Upload CLI Prerelease to Github
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
inputs:
gitHubConnection: "release"
repositoryName: "intiface/intiface-cli-csharp"
action: "edit"
tagSource: "manual"
tag: "420.69.666"
title: "IntifaceCLI C# Prerelease"
assets: |
$(System.ArtifactsDirectory)\**\*.zip
$(System.ArtifactsDirectory)\**\*installer.exe
isPreRelease: true
- task: GitHubRelease@0
displayName: Upload CLI Release to Github
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: "release"
repositoryName: "intiface/intiface-cli-csharp"
action: "create"
tagSource: "auto"
title: "Intiface CLI C# $(gitVersion)"
assets: |
$(System.ArtifactsDirectory)\**\*.zip
$(System.ArtifactsDirectory)\**\*installer.exe
isPreRelease: false