Skip to content

Commit

Permalink
Update pipeline to split signing into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Oct 31, 2019
1 parent 065677f commit 891d249
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 70 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ indent_size = 2
[*.json]
indent_size = 2

# YAML files
[*.{yaml,yml}]
indent_size = 2


# Dotnet code style settings:
[*.{cs,vb}]
# Sort using and Import directives with System.* appearing first
Expand Down
125 changes: 79 additions & 46 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,82 @@ pr:
- master
- rel/*

pool:
vmImage: windows-latest

variables:
BuildConfiguration: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

steps:
- task: UseDotNet@2
inputs:
version: 3.0.x

- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool

- script: nbgv cloud
displayName: Set Version

- task: DotNetCoreCLI@2
inputs:
command: pack
packagesToPack: Zeroconf/Zeroconf.csproj
configuration: $(BuildConfiguration)
packDirectory: $(Build.ArtifactStagingDirectory)\Packages
displayName: Build / Pack

- task: PowerShell@2
displayName: Authenticode Sign artifacts
inputs:
filePath: scripts/Sign-Package.ps1
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: $(Build.ArtifactStagingDirectory)\Packages
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))

- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)\Packages
artifactType: container
artifactName: Packages

stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: windows-latest

variables:
BuildConfiguration: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

steps:
- task: UseDotNet@2
inputs:
version: 3.0.x

- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool

- script: nbgv cloud
displayName: Set Version

- task: DotNetCoreCLI@2
inputs:
command: pack
packagesToPack: Zeroconf/Zeroconf.csproj
configuration: $(BuildConfiguration)
packDirectory: $(Build.ArtifactStagingDirectory)\Packages
displayName: Build / Pack

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

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

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

- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
--input "**/*.nupkg" `
--config "$(Pipeline.Workspace)\config\signclient.json" `
--user "$(SignClientUser)" `
--secret "$(SignClientSecret)" `
--name "Zeroconf" `
--description "Zeroconf" `
--descriptionUrl "https://github.com/onovotny/Zeroconf"
displayName: Sign packages
- publish: $(Pipeline.Workspace)/BuildPackages
displayName: Publish Signed Packages
artifact: SignedPackages
File renamed without changes.
24 changes: 0 additions & 24 deletions scripts/Sign-Package.ps1

This file was deleted.

0 comments on commit 891d249

Please sign in to comment.