From 678b6ca6624bbcfef86b4c7eb9dbde1d5ed653c0 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Tue, 22 Jun 2021 14:53:11 -0700 Subject: [PATCH] Fix CI to account for removal of bin directory. --- .ci/ci.yml | 4 +--- .ci/ci_auto.yml | 40 +--------------------------------------- .ci/ci_release.yml | 40 +--------------------------------------- doBuild.ps1 | 2 -- 4 files changed, 3 insertions(+), 83 deletions(-) diff --git a/.ci/ci.yml b/.ci/ci.yml index c76d10ea9..9df554fec 100644 --- a/.ci/ci.yml +++ b/.ci/ci.yml @@ -67,10 +67,8 @@ stages: Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" Import-Module -Name $modPath -Force # - # First build for netstandard2.0 framework + # Build for netstandard2.0 framework $(Build.SourcesDirectory)/build.ps1 -Build -Clean -BuildConfiguration Release -BuildFramework 'netstandard2.0' - # Next build for net472 framework - $(Build.SourcesDirectory)/build.ps1 -Build -BuildConfiguration Release -BuildFramework 'net472' displayName: Build and publish artifact - pwsh: | diff --git a/.ci/ci_auto.yml b/.ci/ci_auto.yml index 4549378c0..cfd7ceb00 100644 --- a/.ci/ci_auto.yml +++ b/.ci/ci_auto.yml @@ -73,10 +73,8 @@ stages: Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" Import-Module -Name $modPath -Force # - # First build for netstandard2.0 framework + # Build for netstandard2.0 framework $(Build.SourcesDirectory)/build.ps1 -Build -Clean -BuildConfiguration Release -BuildFramework 'netstandard2.0' - # Next build for net472 framework - $(Build.SourcesDirectory)/build.ps1 -Build -BuildConfiguration Release -BuildFramework 'net472' displayName: Build and publish artifact - pwsh: | @@ -112,12 +110,6 @@ stages: Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "DscResources") -Dest $createdSignSrcPath -Recurse -Force -Verbose Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "Modules") -Dest $createdSignSrcPath -Recurse -Force -Verbose - $net472Path = Join-Path -Path $createdSignSrcPath -ChildPath "net472" - if (! (Test-Path -Path $net472Path)) { - $null = New-Item -Path $net472Path -ItemType Directory -Verbose - } - Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "net472\PowerShellGet.*") -Dest $net472Path -Force -Verbose - $netStandardPath = Join-Path -Path $createdSignSrcPath -ChildPath "netstandard2.0" if (! (Test-Path -Path $netStandardPath)) { $null = New-Item -Path $netStandardPath -ItemType Directory -Verbose @@ -186,21 +178,6 @@ stages: if (! (Test-Path -Path $thirdPartySignSrcPath)) { $null = New-Item -Path $thirdPartySignSrcPath -ItemType Directory -Verbose } - - # Net472 directory - $net472Path = Join-Path -Path $thirdPartySignSrcPath -ChildPath "net472" - if (! (Test-Path -Path $net472Path)) { - $null = New-Item -Path $net472Path -ItemType Directory -Verbose - } - Get-ChildItem -Path (Join-Path -Path $srcPath -ChildPath "net472") -Filter '*.dll' | Foreach-Object { - if ($_.Name -ne 'PowerShellGet.dll') { - $sig = Get-AuthenticodeSignature -FilePath $_.FullName - if ($sig.Status -ne 'Valid' -or $sig.SignerCertificate.Subject -notlike '*Microsoft*' -or $sig.SignerCertificate.Issuer -notlike '*Microsoft Code Signing PCA*') { - # Copy for third party signing - Copy-Item -Path $_.FullName -Dest $net472Path -Force -Verbose - } - } - } # NetStandard directory $netStandardPath = Join-Path -Path $thirdPartySignSrcPath -ChildPath "netstandard2.0" @@ -256,21 +233,6 @@ stages: # en-US Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "en-US") -Dest $signOutPath -Recurse - # Net472 directory - $net472SignedOutPath = Join-Path -Path $signOutPath -ChildPath "net472" - if (! (Test-Path -Path $net472SignedOutPath)) { - $null = New-Item -Path $net472SignedOutPath -ItemType Directory -Verbose - } - Get-ChildItem -Path (Join-Path -Path $srcPath -ChildPath "net472") -Filter '*.dll' | Foreach-Object { - if ($_.Name -ne 'PowerShellGet.dll') { - $sig = Get-AuthenticodeSignature -FilePath $_.FullName - if ($sig.Status -eq 'Valid' -and ($sig.SignerCertificate.Subject -like '*Microsoft*' -and $sig.SignerCertificate.Issuer -like '*Microsoft Code Signing PCA*')) { - # Copy already signed files directly to output - Copy-Item -Path $_.FullName -Dest $net472SignedOutPath -Force -Verbose - } - } - } - # NetStandard directory $netStandardSignedOutPath = Join-Path -Path $signOutPath -ChildPath "netstandard2.0" if (! (Test-Path -Path $netStandardSignedOutPath)) { diff --git a/.ci/ci_release.yml b/.ci/ci_release.yml index 01b468471..9035e2676 100644 --- a/.ci/ci_release.yml +++ b/.ci/ci_release.yml @@ -72,10 +72,8 @@ stages: Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" Import-Module -Name $modPath -Force # - # First build for netstandard2.0 framework + # Build for netstandard2.0 framework $(Build.SourcesDirectory)/build.ps1 -Build -Clean -BuildConfiguration Release -BuildFramework 'netstandard2.0' - # Next build for net472 framework - $(Build.SourcesDirectory)/build.ps1 -Build -BuildConfiguration Release -BuildFramework 'net472' displayName: Build and publish artifact - pwsh: | @@ -111,12 +109,6 @@ stages: Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "DscResources") -Dest $createdSignSrcPath -Recurse -Force -Verbose Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "Modules") -Dest $createdSignSrcPath -Recurse -Force -Verbose - $net472Path = Join-Path -Path $createdSignSrcPath -ChildPath "net472" - if (! (Test-Path -Path $net472Path)) { - $null = New-Item -Path $net472Path -ItemType Directory -Verbose - } - Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "net472\PowerShellGet.*") -Dest $net472Path -Force -Verbose - $netStandardPath = Join-Path -Path $createdSignSrcPath -ChildPath "netstandard2.0" if (! (Test-Path -Path $netStandardPath)) { $null = New-Item -Path $netStandardPath -ItemType Directory -Verbose @@ -184,21 +176,6 @@ stages: if (! (Test-Path -Path $thirdPartySignSrcPath)) { $null = New-Item -Path $thirdPartySignSrcPath -ItemType Directory -Verbose } - - # Net472 directory - $net472Path = Join-Path -Path $thirdPartySignSrcPath -ChildPath "net472" - if (! (Test-Path -Path $net472Path)) { - $null = New-Item -Path $net472Path -ItemType Directory -Verbose - } - Get-ChildItem -Path (Join-Path -Path $srcPath -ChildPath "net472") -Filter '*.dll' | Foreach-Object { - if ($_.Name -ne 'PowerShellGet.dll') { - $sig = Get-AuthenticodeSignature -FilePath $_.FullName - if ($sig.Status -ne 'Valid' -or $sig.SignerCertificate.Subject -notlike '*Microsoft*' -or $sig.SignerCertificate.Issuer -notlike '*Microsoft Code Signing PCA*') { - # Copy for third party signing - Copy-Item -Path $_.FullName -Dest $net472Path -Force -Verbose - } - } - } # NetStandard directory $netStandardPath = Join-Path -Path $thirdPartySignSrcPath -ChildPath "netstandard2.0" @@ -254,21 +231,6 @@ stages: # en-US Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "en-US") -Dest $signOutPath -Recurse - # Net472 directory - $net472SignedOutPath = Join-Path -Path $signOutPath -ChildPath "net472" - if (! (Test-Path -Path $net472SignedOutPath)) { - $null = New-Item -Path $net472SignedOutPath -ItemType Directory -Verbose - } - Get-ChildItem -Path (Join-Path -Path $srcPath -ChildPath "net472") -Filter '*.dll' | Foreach-Object { - if ($_.Name -ne 'PowerShellGet.dll') { - $sig = Get-AuthenticodeSignature -FilePath $_.FullName - if ($sig.Status -eq 'Valid' -and ($sig.SignerCertificate.Subject -like '*Microsoft*' -and $sig.SignerCertificate.Issuer -like '*Microsoft Code Signing PCA*')) { - # Copy already signed files directly to output - Copy-Item -Path $_.FullName -Dest $net472SignedOutPath -Force -Verbose - } - } - } - # NetStandard directory $netStandardSignedOutPath = Join-Path -Path $signOutPath -ChildPath "netstandard2.0" if (! (Test-Path -Path $netStandardSignedOutPath)) { diff --git a/doBuild.ps1 b/doBuild.ps1 index c6ae2a80c..a024b035d 100644 --- a/doBuild.ps1 +++ b/doBuild.ps1 @@ -20,8 +20,6 @@ function DoBuild # Copy module script files Write-Verbose -Verbose "Copy-Item ${SrcPath}/${ModuleName}.psd1 to $BuildOutPath" Copy-Item -Path "${SrcPath}/${ModuleName}.psd1" -Dest "$BuildOutPath" -Force - Write-Verbose -Verbose "Copy Item ${SrcPath}/PSModule.psm1 to $BuildOutPath" - Copy-Item -Path "${SrcPath}/PSModule.psm1" -Dest "$BuildOutPath" -Force #Copy module format ps1xml file Write-Verbose -Verbose -Message "Copy-Item ${SrcPath}/${FormatFileName}.ps1xml to $BuildOutPath"