forked from microsoft/CSS-Exchange
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipeline-release.yml
110 lines (102 loc) · 3.25 KB
/
azure-pipeline-release.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
trigger:
branches:
include:
- release
pool:
vmImage: 'windows-latest'
steps:
- pwsh: |
cd .\.build
.\Build.ps1
displayName: "Build Script"
- task: EsrpCodeSigning@2
condition: and(succeeded(), ne (variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
ConnectedServiceName: 'CSS Exchange Code Sign'
FolderPath: 'dist'
Pattern: '*.ps1'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "CSS Exchange"
},
{
"parameterName": "OpusInfo",
"parameterValue": "https://github.com/microsoft/CSS-Exchange"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd sha256"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
- pwsh: |
cd .\.build
.\BuildScriptVersions.ps1
displayName: "Build ScriptVersions.txt"
- pwsh: |
Get-Content dist\ScriptVersions.txt
displayName: "Display Script Versions file"
- pwsh: |
$tag = "v$((Get-Date).ToString(`"yy.MM.dd.HHmm`"))"
Write-Host "##vso[task.setvariable variable=ReleaseTagValue]$tag"
(Get-Content .\dist\ScriptVersions.txt) -replace '^(\S+.ps1)', ('[$1](https://github.com/microsoft/CSS-Exchange/releases/download/' + $tag + '/$1)') | Out-File dist\ScriptVersions.txt
Get-Content dist\ScriptVersions.txt
displayName: "Setting Script Versions text file"
- task: GitHubRelease@0
displayName: 'Create GitHub Release - Draft'
condition: and(succeeded(), ne (variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
gitHubConnection: 'GitHub Release'
repositoryName: microsoft/CSS-Exchange
action: create
tagSource: manual
tagPattern: 'v[0-9].[0-9].[0-9].[0-9]'
tag: $(ReleaseTagValue)
title: $(ReleaseTagValue)
releaseNotesSource: 'file'
releaseNotesFile: dist\ScriptVersions.txt
assets: |
dist\*.ps1
dist\*.nse
dist\*.zip
dist\*.txt
dist\*.csv
addChangeLog: true
isDraft: true
- task: GitHubRelease@0
displayName: 'Publish GitHub Release'
condition: and(succeeded(), ne (variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
gitHubConnection: 'GitHub Release'
repositoryName: microsoft/CSS-Exchange
action: edit
tagSource: manual
tagPattern: 'v[0-9].[0-9].[0-9].[0-9]'
tag: $(ReleaseTagValue)
title: $(ReleaseTagValue)
releaseNotesSource: 'file'
releaseNotesFile: dist\ScriptVersions.txt
assetUploadMode: replace
addChangeLog: true
isDraft: false