This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr) | ||
|
||
trigger: none | ||
|
||
resources: | ||
repositories: | ||
- repository: ComplianceRepo | ||
type: github | ||
endpoint: ComplianceGHRepo | ||
name: PowerShell/compliance | ||
|
||
variables: | ||
- name: PackageName | ||
value: 'Microsoft.PowerShell.Archive' | ||
- name: PackageVersion | ||
value: '' | ||
- name: BuildOutDir | ||
value: '' | ||
|
||
stages: | ||
- stage: Build | ||
displayName: Build module | ||
pool: | ||
name: 1ES | ||
demands: | ||
- ImageOverride -equals PSMMS2019-Secure | ||
jobs: | ||
- job: BuildPkg | ||
displayName: Build module | ||
steps: | ||
|
||
- pwsh: | | ||
& $(Build.SourcesDirectory)\SimpleBuild.ps1 | ||
displayName: Build Microsoft.PowerShell.Archive module | ||
condition: succeededOrFailed() | ||
- pwsh: | | ||
dir "$(BuildOutDir)\*" -Recurse | ||
displayName: Show BuildOutDirectory | ||
- template: Sbom.yml@ComplianceRepo | ||
parameters: | ||
BuildDropPath: "$(BuildOutDir)" | ||
Build_Repository_Uri: 'https://github.com/PowerShell/Microsoft.PowerShell.Archive' | ||
PackageName: $(PackageName) | ||
PackageVersion: $(PackageVersion) | ||
|
||
- pwsh: | | ||
dir "$(BuildOutDir)\*" -Recurse | ||
displayName: Show BuildOutDirectory | ||
- pwsh: | | ||
$signSrcPath = "$(BuildOutDir)" | ||
# Set signing src path variable | ||
$vstsCommandString = "vso[task.setvariable variable=signSrcPath]${signSrcPath}" | ||
Write-Host "sending " + $vstsCommandString | ||
Write-Host "##$vstsCommandString" | ||
$signOutPath = "$(Build.SourcesDirectory)\signed\Microsoft.PowerShell.Archive" | ||
$null = New-Item -ItemType Directory -Path $signOutPath | ||
# Set signing out path variable | ||
$vstsCommandString = "vso[task.setvariable variable=signOutPath]${signOutPath}" | ||
Write-Host "sending " + $vstsCommandString | ||
Write-Host "##$vstsCommandString" | ||
# Set path variable for guardian codesign validation | ||
$vstsCommandString = "vso[task.setvariable variable=GDN_CODESIGN_TARGETDIRECTORY]${signOutPath}" | ||
Write-Host "sending " + $vstsCommandString | ||
Write-Host "##$vstsCommandString" | ||
displayName: Setup variables for signing | ||
- pwsh: | | ||
Copy-Item -Path "$(signSrcPath)\*" -Destination "$(signOutPath)" | ||
displayName: Fake Signing | ||
- pwsh: | | ||
Compress-Archive -Path "$(signOutPath)\*" -DestinationPath "$(System.ArtifactsDirectory)\Microsoft.PowerShell.Archive.zip" | ||
displayName: Create Microsoft.PowerShell.Archive.zip | ||
- publish: $(System.ArtifactsDirectory)\Microsoft.PowerShell.Archive.zip | ||
artifact: SignedModule |