Skip to content
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
85 changes: 27 additions & 58 deletions .ci/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ pr:
include:
- master

variables:
- group: ESRP
resources:
repositories:
- repository: ComplianceRepo
type: github
endpoint: ComplianceGHRepo
name: PowerShell/compliance

stages:
- stage: Build
Expand All @@ -20,7 +24,8 @@ stages:
- job: BuildPkg
displayName: Build Package
pool:
name: Package ES CodeHub Lab E
vmImage: windows-latest

steps:
- powershell: |
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
Expand Down Expand Up @@ -90,53 +95,14 @@ stages:
$modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject
Write-Verbose -Verbose "Importing PSPackageProject from: $modPath"
Import-Module -Name $modPath -Force
#
$config = Get-PSPackageProjectConfiguration
$signSrcPath = "$($config.BuildOutputPath)\$($config.ModuleName)"
$signOutPath = "$($config.SignedOutputPath)\$($config.ModuleName)"
if (! (Test-Path -Path $signOutPath)) {
$null = New-Item -Path $signOutPath -ItemType Directory
}

# Set signing src path variable
$vstsCommandString = "vso[task.setvariable variable=signSrcPath]${signSrcPath}"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"

# Set signing out path variable
$vstsCommandString = "vso[task.setvariable variable=signOutPath]${signOutPath}"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
displayName: Set up for code signing
condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), ne(variables['SkipSigning'], 'True'))

- pwsh: |
Get-ChildItem -Path env:
displayName: Capture environment for module code signing
condition: succeededOrFailed()

- template: ./templates/sign.yml
parameters:
buildOutputPath: $(signSrcPath)
signOutputPath: $(signOutPath)
certificateId: "CP-230012"
pattern: '*.dll,*.psd1,*.psm1'

- pwsh: |
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
$env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
$modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject
Write-Verbose -Verbose "Importing PSPackageProject from: $modPath"
Import-Module -Name $modPath -Force
#
if ($env:SkipSigning -eq 'True')
{
$(Build.SourcesDirectory)/build.ps1 -Publish
}
else
{
$(Build.SourcesDirectory)/build.ps1 -Publish -Signed
}
$srcModulePath = Resolve-Path -Path "$($config.BuildOutputPath)/$($config.ModuleName)"
Get-ChildItem $srcModulePath
$artifactName = "$($config.ModuleName)"
Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$srcModulePath"
#
$(Build.SourcesDirectory)/build.ps1 -Publish
displayName: Create module artifact

- stage: Compliance
Expand All @@ -145,9 +111,18 @@ stages:
jobs:
- job: ComplianceJob
pool:
name: Package ES CodeHub Lab E
vmImage: windows-latest
steps:
- template: compliance.yml
- checkout: self
clean: true
- checkout: ComplianceRepo
clean: true
- download: current
artifact: 'Microsoft.PowerShell.SecretStore'
- template: ci-compliance.yml@ComplianceRepo
parameters:
# credscan
suppressionsFile: ''

- stage: Test
displayName: Test Package
Expand All @@ -157,13 +132,13 @@ stages:
parameters:
jobName: TestPkgWin
displayName: PowerShell Core on Windows
imageName: windows-2019
imageName: windows-latest

- template: test.yml
parameters:
jobName: TestPkgWinPS
displayName: Windows PowerShell on Windows
imageName: windows-2019
imageName: windows-latest
powershellExecutable: powershell

- template: test.yml
Expand All @@ -177,9 +152,3 @@ stages:
jobName: TestPkgWinMacOS
displayName: PowerShell Core on macOS
imageName: macOS-10.14

- stage: Release
displayName: Release Package
condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), eq(variables['Publish'], 'True'))
jobs:
- template: release.yml
145 changes: 0 additions & 145 deletions .ci/compliance.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .ci/release.yml

This file was deleted.

Loading