@@ -18,7 +18,6 @@ variables:
18
18
- group : sonar-dotnet-variables
19
19
- group : sonarsource-build-variables
20
20
- group : artifactory_access
21
- - group : digicert-keylocker
22
21
# ~https://github.com/SonarSource/re-ci-images/blob/master/docker/mvn/settings-private.xml
23
22
- name : ARTIFACTORY_PRIVATE_USERNAME
24
23
value : $[variables.ARTIFACTORY_PRIVATE_READER_USERNAME]
@@ -32,8 +31,6 @@ variables:
32
31
value : ' $(Build.SourcesDirectory)\coverage'
33
32
- name : UnitTestExclusionsPattern
34
33
value : ' analyzers/tests/SonarAnalyzer.Test/TestCases/**/*'
35
- - name : isReleaseBranch
36
- value : ${{ or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/branch-')) }}
37
34
- name : vsVersion
38
35
value : ' 17.0'
39
36
@@ -46,7 +43,6 @@ resources:
46
43
47
44
stages :
48
45
- stage : build
49
- # Build the dotnet analyzers and stage to repox
50
46
displayName : ' Build:'
51
47
jobs :
52
48
- job : dotnetBuildjob
@@ -80,57 +76,13 @@ stages:
80
76
msbuildArgs : ' /p:Sha1=$(Build.SourceVersion) /p:BranchName=$(Build.SourceBranchName) /p:BuildNumber=$(Build.BuildId) /p:BuildConfiguration=$(BuildConfiguration)'
81
77
vsVersion : $(vsVersion)
82
78
83
- - task : DownloadSecureFile@1
84
- displayName : ' Download snk file'
85
- name : snk
86
- inputs :
87
- secureFile : SonarSourceSecret.snk
88
-
89
- - task : DownloadSecureFile@1
90
- # This file is used by the "DigiCert Signing Manager KSP" Key Storage Provider to authenticate against the DigiCert private key provider server.
91
- displayName : ' Download p12 file'
92
- name : SM_CLIENT_CERT
93
- inputs :
94
- secureFile : digicert_authentication_certificate.p12
95
-
96
- - task : DownloadSecureFile@1
97
- # This file contains the signing certificate without the private key. The private key will be downloaded later, during the signing process.
98
- displayName : ' Download crt file'
99
- name : SM_CLIENT_CRT
100
- inputs :
101
- secureFile : cert_525594307.crt
102
-
103
- - task : PowerShell@2
104
- displayName : " Signing certificate setup"
105
- # Initialize the DigiCert Private Key Provider.
106
- # What we think it does: The smctl tool authenticates with a client certificate (SM_CLIENT_CERT_FILE) and a client password (SM_CLIENT_CERT_PASSWORD).
107
- # It uses an API Key (SM_API_KEY) and the ID of the certificate (SM_CERT) to check if the authenticated client is authorized to use the
108
- # certificate specified and synchronize (potentially private) information about the certificate.
109
- condition : eq(variables.isReleaseBranch, 'True')
110
- env :
111
- SM_CLIENT_CERT_FILE : $(SM_CLIENT_CERT.secureFilePath)
112
- SM_CLIENT_CERT_PASSWORD : $(SM_CLIENT_CERT_PASSWORD)
113
- SM_API_KEY : $(SM_API_KEY)
114
- SM_CERT : $(SM_CERT)
115
- inputs :
116
- targetType : ' inline'
117
- script : |
118
- Write-Output "smctl sync:"
119
- smctl windows certsync
120
-
121
79
- task : VSBuild@1
122
- displayName : " Build and sign SonarAnalyzer solution"
123
- env :
124
- SM_CLIENT_CRT_FILE : $(SM_CLIENT_CRT.secureFilePath)
125
- SM_CLIENT_CERT_FILE : $(SM_CLIENT_CERT.secureFilePath)
126
- SM_CLIENT_CERT_PASSWORD : $(SM_CLIENT_CERT_PASSWORD)
127
- SM_API_KEY : $(SM_API_KEY)
128
- SM_CERT : $(SM_CERT)
80
+ displayName : " Build SonarAnalyzer solution"
129
81
inputs :
130
82
solution : ' $(solution)'
131
83
platform : ' $(buildPlatform)'
132
84
configuration : ' $(buildConfiguration)'
133
- msbuildArgs : ' /p:SignAssembly=$(isReleaseBranch) /p:AssemblyOriginatorKeyFile="$(snk.secureFilePath)" /p: Sha1=$(Build.SourceVersion) /p:BuildNumber=$(Build.BuildId) /p:WarningLevel=0'
85
+ msbuildArgs : ' /p:Sha1=$(Build.SourceVersion) /p:BuildNumber=$(Build.BuildId) /p:WarningLevel=0'
134
86
vsVersion : $(vsVersion)
135
87
136
88
- task : NuGetCommand@2
@@ -143,20 +95,6 @@ stages:
143
95
verbosityPack : ' Detailed'
144
96
publishPackageMetadata : true
145
97
146
- - task : PowerShell@2
147
- displayName : " Sign NuGet packages"
148
- condition : eq(variables.isReleaseBranch, 'True')
149
- env :
150
- PACKAGES_PATH : ' $(Build.ArtifactStagingDirectory)\packages\*.nupkg'
151
- SM_CLIENT_CERT_FILE : $(SM_CLIENT_CERT.secureFilePath)
152
- SM_CLIENT_CERT_PASSWORD : $(SM_CLIENT_CERT_PASSWORD)
153
- SM_API_KEY : $(SM_API_KEY)
154
- SM_CERT : $(SM_CERT)
155
- inputs :
156
- targetType : ' inline'
157
- script : |
158
- nuget sign "$env:PACKAGES_PATH" -Overwrite -HashAlgorithm SHA256 -CertificateFingerprint $(SM_CERT_FP) -Timestamper http://timestamp.digicert.com -TimestampHashAlgorithm SHA256
159
-
160
98
- task : PublishBuildArtifacts@1
161
99
displayName : ' Publish NuGet packages as build artifacts'
162
100
inputs :
0 commit comments