2323 Write-Host("##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG")
2424 Write-Host($VERSION_TAG)
2525 - task : CmdLine@2
26+ condition : ne(variables.OS, 'windows')
2627 displayName : ' Build ${{ parameters.OS }}/${{ parameters.Type }} distribution'
2728 inputs :
2829 script : release/${{ parameters.OS }}/${{ parameters.Type }}/pipeline.sh
@@ -31,8 +32,87 @@ steps:
3132 CLI_VERSION : $(VERSION_TAG)
3233 BUILD_OUTPUT : $(Pipeline.Workspace)
3334 BUILD_STAGINGDIRECTORY : $(Build.ArtifactStagingDirectory)
35+ - task : VSBuild@1
36+ condition : eq(variables.OS, 'windows')
37+ displayName : ' Build Windows MSI distribution'
38+ inputs :
39+ solution : ' $(Build.SourcesCliDirectory)\release\windows\msi\sqlcmd.wixproj'
40+ msbuildArchitecture : ' x86'
41+ msbuildArgs : ' /p:Configuration=Release'
42+ env :
43+ CLI_VERSION : $(VERSION_TAG)
44+ - task : EsrpCodeSigning@1
45+ condition : eq(variables.OS, 'windows')
46+ inputs :
47+ ConnectedServiceName : ' Code Signing'
48+ FolderPath : ' $(Build.SourcesDirectory)/release/windows/msi/bin/Release'
49+ Pattern : ' *.msi'
50+ signConfigType : ' inlineSignParams'
51+ inlineOperation : |
52+ [
53+ {
54+ "keyCode": "CP-230012",
55+ "operationSetCode": "SigntoolSign",
56+ "parameters": [
57+ {
58+ "parameterName": "OpusName",
59+ "parameterValue": "Sqlcmd Tools"
60+ },
61+ {
62+ "parameterName": "OpusInfo",
63+ "parameterValue": "https://github.com/microsoft/go-sqlcmd"
64+ },
65+ {
66+ "parameterName": "PageHash",
67+ "parameterValue": "/NPH"
68+ },
69+ {
70+ "parameterName": "FileDigest",
71+ "parameterValue": "/fd sha256"
72+ },
73+ {
74+ "parameterName": "TimeStamp",
75+ "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
76+ }
77+ ],
78+ "toolName": "signtool.exe",
79+ "toolVersion": "6.2.9304.0"
80+ },
81+ {
82+ "keyCode": "CP-230012",
83+ "operationSetCode": "SigntoolVerify",
84+ "parameters": [
85+ {
86+ "parameterName": "VerifyAll",
87+ "parameterValue": "/all"
88+ }
89+ ],
90+ "toolName": "signtool.exe",
91+ "toolVersion": "6.2.9304.0"
92+ }
93+ ]
94+ SessionTimeout : ' 600'
95+ MaxConcurrency : ' 50'
96+ MaxRetryAttempts : ' 20'
97+ - task : Bash@3
98+ condition : eq(variables.OS, 'windows')
99+ displayName : ' Rename MSI'
100+ inputs :
101+ targetType : ' inline'
102+ script : |
103+ mv "$(Build.SourcesDirectory)/release/windows/msi/bin/Release/sqlcmd.msi" "$(Build.SourcesDirectory)/release/windows/msi/bin/Release/sqlcmd_${CLI_VERSION}-${CLI_VERSION_REVISION}.msi"
104+ env :
105+ CLI_VERSION : $(VERSION_TAG)
106+ CLI_VERSION_REVISION : 1
107+ - task : CopyFiles@2
108+ condition : eq(variables.OS, 'windows')
109+ displayName : ' Copy MSI to: $(Build.ArtifactStagingDirectory)'
110+ inputs :
111+ sourceFolder : $(Build.SourcesDirectory)/release/windows/msi/bin/Release
112+ contents : ' ?(*.msi|*.md)'
113+ TargetFolder : $(Build.ArtifactStagingDirectory)
34114- task : EsrpCodeSigning@1
35- condition : ne(variables.Type, 'docker')
115+ condition : and(eq(variables.OS, 'linux'), ne(variables.Type, 'docker') )
36116 inputs :
37117 ConnectedServiceName : ' Code Signing'
38118 FolderPath : $(Build.ArtifactStagingDirectory)
0 commit comments