Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Create CI.yml (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayousuf23 authored Jul 7, 2022
1 parent 5c1def9 commit e29e7b7
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .azdevops/CI.yml
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

0 comments on commit e29e7b7

Please sign in to comment.