-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipeline Moved to new Certification #5017
Changes from 64 commits
f155635
a1826a5
ff8a7b4
117ebd5
637cea6
da85b73
55a71f0
ddb93e2
2fa5a85
57b91af
11f79bb
3ae7a35
31768e1
c8b007e
55d4300
eb895cd
a39c435
968f316
0babd2e
b7399c7
9728409
684f62b
237ed92
e5e084d
9cbba6b
a6db1de
8ebe94f
beafd81
06a9764
d0b13a6
08ee0c3
1946f40
ad23c66
dc3c908
5b7de0c
d68dd23
a5dc77c
a95a325
26bb7eb
5f22f7c
69fbaa4
a35f998
6280352
45c7dc4
a1a573e
e5942da
83c45e3
6d964b2
2b5391d
72ce792
96be7aa
8f9b9df
8976dc2
23e1260
d0e7cb2
90fe757
b2f136e
7df3bcb
31d0b70
9c788f8
e08e15e
15fdb0c
9192108
b31dc6c
644c5e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
variables: | ||
- group: sonarsource-build-variables | ||
- group: digicert-keylocker | ||
- name: BuildParameters.solution | ||
value: SonarLint.VisualStudio.Integration.sln | ||
|
||
|
@@ -68,12 +69,6 @@ jobs: | |
targetType: filePath | ||
filePath: $(System.DefaultWorkingDirectory)\pipeline\scripts\read-versions.props.ps1 | ||
|
||
- task: PowerShell@2 | ||
displayName: Locate signtool.exe | ||
inputs: | ||
targetType: filePath | ||
filePath: $(System.DefaultWorkingDirectory)\pipeline\scripts\locate-signtool.ps1 | ||
|
||
- task: PowerShell@2 | ||
displayName: (VS2022 only) Set VsixVersion as a build property for the release pipeline to use | ||
env: | ||
|
@@ -104,11 +99,32 @@ jobs: | |
retryCount: 5 | ||
|
||
- task: DownloadSecureFile@1 | ||
name: pfx | ||
displayName: Download pfx file | ||
name: SM_CLIENT_CERT | ||
displayName: Download p12 file | ||
inputs: | ||
secureFile: SonarSource-2021-2023.pfx | ||
secureFile: digicert_authentication_certificate.p12 | ||
retryCount: 5 | ||
|
||
- task: SSMClientToolsSetup@1 | ||
displayName: Client Tools Setup | ||
condition: eq(variables['SHOULD_SIGN'], 'true') | ||
|
||
- task: SSMSigningToolsSetup@1 | ||
displayName: Signing Tools Setup | ||
condition: eq(variables['SHOULD_SIGN'], 'true') | ||
|
||
- task: PowerShell@2 | ||
displayName: Syncs certificates to local Windows store | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
Write-Output "smctl healthcheck:" | ||
smctl healthcheck | ||
Write-Output "smctl sync:" | ||
smctl windows certsync | ||
env: | ||
SM_API_KEY: $(SM_API_KEY) | ||
condition: eq(variables['SHOULD_SIGN'], 'true') | ||
|
||
# Specify the version of Java to use. | ||
# See https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/java-tool-installer-v0?view=azure-pipelines | ||
|
@@ -154,12 +170,25 @@ jobs: | |
inputs: | ||
solution: $(BuildParameters.solution) | ||
vsVersion: 17.0 | ||
msbuildArgs: /p:VsTargetVersion=$(vsTargetVersion) /p:DeployExtension=false /p:SignArtifacts=$(SHOULD_SIGN) /p:AssemblyOriginatorKeyFile="$(snk.secureFilePath)" /p:pfxCertificatePath="$(pfx.secureFilePath)" /p:pfxPassword="$(pfxPassword2021-2023)" /p:pfxSha1=$(pfxSha1-2021-2023) /p:Sha1=$(Build.SourceVersion) /p:BuildNumber=$(Build.BuildId) $(AdditionalMSBuildArgs) | ||
msbuildArgs: /p:VsTargetVersion=$(vsTargetVersion) /p:DeployExtension=false /p:SignArtifacts=false /p:AssemblyOriginatorKeyFile="$(snk.secureFilePath)" /p:Sha1=$(Build.SourceVersion) /p:BuildNumber=$(Build.BuildId) $(AdditionalMSBuildArgs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now instead of signing the artifact on build we sign them after the build.
pavel-mikula-sonarsource marked this conversation as resolved.
Show resolved
Hide resolved
pavel-mikula-sonarsource marked this conversation as resolved.
Show resolved
Hide resolved
|
||
platform: $(BuildPlatform) | ||
configuration: $(BuildConfiguration) | ||
maximumCpuCount: true | ||
logFileVerbosity: diagnostic | ||
|
||
- task: PowerShell@2 | ||
displayName: Sign Vsix file | ||
env: | ||
PACKAGES_PATH: '$(Build.SourcesDirectory)\binaries\SonarLint.VSIX-$(SONAR_PROJECT_VERSION).$(Build.BuildId)-$(vsTargetVersion).vsix' | ||
pavel-mikula-sonarsource marked this conversation as resolved.
Show resolved
Hide resolved
|
||
SM_HOST: $(SM_HOST) | ||
SM_API_KEY: $(SM_API_KEY) | ||
SM_CLIENT_CERT_PASSWORD: $(SM_CLIENT_CERT_PASSWORD) | ||
SM_CLIENT_CERT_FILE: $(SM_CLIENT_CERT.secureFilePath) | ||
inputs: | ||
targetType: 'inline' | ||
script: nuget sign "$env:PACKAGES_PATH" -Overwrite -HashAlgorithm SHA256 -CertificateFingerprint $(SM_CERT_FP) -Timestamper http://timestamp.digicert.com -TimestampHashAlgorithm SHA256 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By trials done by Tom nuget sign is the only command that works for vsix signing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you try to remove the
|
||
condition: eq(variables['SHOULD_SIGN'], 'true') | ||
|
||
- task: CopyFiles@2 | ||
displayName: 'Copy asmref files to: $(Build.ArtifactStagingDirectory) in the event of a build failure' | ||
inputs: | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand who sets
SHOULD_SIGN
to true and when this happens. Could give me a hint? :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/SonarSource/sonarlint-visualstudio/blob/master/pipeline/scripts/should-sign-vsix.ps1#L43
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now I got it. Thanks!