@@ -39,7 +39,7 @@ resources:
3939 name : PowerShell/compliance
4040
4141stages :
42- - stage : Build and Sign
42+ - stage : BuildAndSign
4343 displayName : Build and Sign
4444 jobs :
4545 - job : ' BuildAndSign'
@@ -51,15 +51,21 @@ stages:
5151 demands :
5252 - ImageOverride -equals PSMMS2019-Secure
5353 steps :
54+ - task : UseDotNet@2
55+ displayName : ' Use .NET Core sdk'
56+ inputs :
57+ packageType : sdk
58+ includePreviewVersions : true
59+ version : 6.x
5460 - powershell : |
5561 Get-ChildItem -Path env:
5662 displayName: Capture environment
5763 condition: succeededOrFailed()
58- steps :
5964 - pwsh : |
6065 # build agents get reused so we make sure to remove the old archive
6166 Remove-Item -Path $(Build.SourcesDirectory)/SignedZip -Recurse -Force -ErrorAction Ignore
62- Remove-Item -Path $(Build.SourcesDirectory)/Microsoft.PowerShell.TextUtility -Recurse -Force -ErrorAction Ignore
67+ Remove-Item -Path $(Build.SourcesDirectory)/out -Recurse -Force -ErrorAction Ignore
68+ Remove-Item -Path $(Build.SourcesDirectory)/signed -Recurse -Force -ErrorAction Ignore
6369 .\build.ps1 -Clean
6470 Remove-Item .\out\*.pdb
6571 $packageVersion = (Import-PowerShellDataFile $(Build.SourcesDirectory)/out/Microsoft.PowerShell.TextUtility/Microsoft.PowerShell.TextUtility.psd1).ModuleVersion
@@ -75,9 +81,9 @@ stages:
7581 # the folder which contains the binaries to sign
7682 buildOutputPath : $(Build.SourcesDirectory)/out
7783 # the location to put the signed output
78- signOutputPath : $(Build.SourcesDirectory)/Microsoft.PowerShell.TextUtility
84+ signOutputPath : $(Build.SourcesDirectory)/signed/ Microsoft.PowerShell.TextUtility
7985 # the certificate ID to use
80- certificateId : " CP-230012 "
86+ certificateId : " CP-460906 "
8187 # The file pattern to use
8288 # If not using minimatch: comma separated, with * supported
8389 # If using minimatch: newline separated, with !, **, and * supported.
@@ -89,30 +95,30 @@ stages:
8995
9096 - template : Sbom.yml@ComplianceRepo
9197 parameters :
92- BuildDropPath : $(Build.SourcesDirectory)/out /Microsoft.PowerShell.TextUtility
98+ BuildDropPath : $(Build.SourcesDirectory)/signed /Microsoft.PowerShell.TextUtility
9399 Build_Repository_Uri : ' https://github.com/powershell/textutility'
94100 PackageName : ' Microsoft.PowerShell.TextUtility'
95101 PackageVersion : $(PackageVersion)
96102
97103 - pwsh : |
98- New-Item -Path $(Build.SourcesDirectory)/out/ SignedZip -ItemType Directory -ErrorAction Ignore
99- Compress-Archive -Path $(Build.SourcesDirectory)/Microsoft.PowerShell.TextUtility -DestinationPath $(Build.SourcesDirectory)/out /SignedZip/Microsoft.PowerShell.TextUtility.zip -Force
104+ New-Item -Path $(Build.SourcesDirectory)/SignedZip -ItemType Directory -ErrorAction Ignore
105+ Compress-Archive -Path $(Build.SourcesDirectory)/signed/ Microsoft.PowerShell.TextUtility -DestinationPath $(Build.SourcesDirectory)/SignedZip/Microsoft.PowerShell.TextUtility.zip -Force
100106 displayName: 'Compress archive'
101107 condition: succeededOrFailed()
102108
103109 - task : PublishPipelineArtifact@1
104110 inputs :
105- targetpath : $(Build.SourcesDirectory)/out /Microsoft.PowerShell.TextUtility
111+ targetpath : $(Build.SourcesDirectory)/signed /Microsoft.PowerShell.TextUtility
106112 artifactName : Signed
107113
108114 - task : PublishPipelineArtifact@1
109115 inputs :
110- targetpath : $(Build.SourcesDirectory)/out/ SignedZip
116+ targetpath : $(Build.SourcesDirectory)/SignedZip
111117 artifactName : SignedZip
112118
113119- stage : compliance
114120 displayName : Compliance
115- dependsOn : Build
121+ dependsOn : BuildAndSign
116122 jobs :
117123 - job : Compliance_Job
118124 pool :
0 commit comments