Skip to content
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

Migrate from SignClient to sign tool and specify SDK in global.json #43

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
"version": "3.4.194",
"commands": [
"nbgv"
]
],
"rollForward": false
},
"sign": {
"version": "0.9.1-beta.24325.5",
"commands": [
"sign"
],
"rollForward": false
}
}
}
75 changes: 39 additions & 36 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,58 +21,61 @@ stages:
- task: UseDotNet@2
inputs:
packageType: sdk
displayName: 'Use .NET Core sdk'
useGlobalJson: true
displayName: 'Use .NET SDK'

- script: dotnet tool restore
displayName: Install NBGV and other dotnet tools
displayName: Install dotnet tools

- script: dotnet nbgv cloud
displayName: Set Version

- script: dotnet pack dirs.proj
displayName: Create package(s)

- publish: $(Build.ArtifactStagingDirectory)\Packages
- publish: $(Build.ArtifactStagingDirectory)/Packages
displayName: Publish build packages
artifact: BuildPackages

- publish: config
displayName: Publish signing config
artifact: config

# Keep signing variables in a separate stage
- stage: CodeSign
condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
jobs:
- deployment: CodeSign
- job: CodeSign
displayName: Code Signing
pool:
vmImage: windows-latest
environment: Code Sign - CI
vmImage: windows-latest
variables:
- group: SignClient-DNF
strategy:
runOnce:
deploy:
steps:
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
displayName: Install SignTool tool
- group: SignTool-DNF

steps:
- download: current
artifact: BuildPackages

- task: UseDotNet@2
inputs:
packageType: sdk
useGlobalJson: true
displayName: 'Use .NET SDK'

- script: dotnet tool restore
displayName: Install dotnet tools

- pwsh: |
dotnet sign code azure-key-vault `
"**/*.nupkg" `
--base-directory "$(Pipeline.Workspace)/BuildPackages" `
--file-list "$(Build.SourcesDirectory)/config/filelist.txt" `
--publisher-name "DotNet.ReproducibleBuilds" `
--description "DotNet.ReproducibleBuilds" `
--description-url "https://github.com/dotnet/reproducible-builds" `
--azure-key-vault-tenant-id "$(SignTenantId)" `
--azure-key-vault-client-id "$(SignClientId)" `
--azure-key-vault-client-secret '$(SignClientSecret)' `
--azure-key-vault-certificate "$(SignKeyVaultCertificate)" `
--azure-key-vault-url "$(SignKeyVaultUrl)"
displayName: Sign packages

- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
--input "**/*.nupkg" `
--config "$(Pipeline.Workspace)\config\SignClient.json" `
--user "$(SignClientUser)" `
--secret '$(SignClientSecret)' `
--name "DotNet.ReproducibleBuilds" `
--description "DotNet.ReproducibleBuilds" `
--descriptionUrl "https://github.com/dotnet/reproducible-builds"
displayName: Sign packages

- publish: $(Pipeline.Workspace)/BuildPackages
displayName: Publish Signed Packages
artifact: SignedPackages
- publish: $(Pipeline.Workspace)/BuildPackages
displayName: Publish Signed Packages
artifact: SignedPackages
13 changes: 0 additions & 13 deletions config/SignClient.json

This file was deleted.

Empty file added config/filelist.txt
Empty file.
4 changes: 4 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "major"
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "3.0.4",
"Microsoft.Build.Traversal": "3.0.23"
Expand Down