Skip to content

Fix CI to account for removal of bin directory #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2021
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
4 changes: 1 addition & 3 deletions .ci/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
40 changes: 1 addition & 39 deletions .ci/ci_auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)) {
Expand Down
40 changes: 1 addition & 39 deletions .ci/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)) {
Expand Down
2 changes: 0 additions & 2 deletions doBuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down