FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Enable SBOM creation for script analyzer by JamesWTruher · Pull Request #1762 · PowerShell/PSScriptAnalyzer · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ps1  (1) .psm1  (1) .yaml  (1) .yml  (1) All 4 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 0 additions & 2 deletions .azure-pipelines-ci/ci.yaml
This file contains hidden or 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
Expand Up @@ -26,8 +26,6 @@ stages:
vmImage: ubuntu-18.04
Ubuntu_20_04:
vmImage: ubuntu-20.04
macOS_10_14_Mojave:
vmImage: macOS-10.14
macOS_10_15_Catalina:
vmImage: macOS-10.15
Windows_Server2016_PowerShell_Core:
Expand Down
8 changes: 7 additions & 1 deletion .ci/releaseBuild.yml
This file contains hidden or 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
Expand Up @@ -136,11 +136,17 @@ stages:
**/Pluralize*.dll
**/Newtonsoft*.dll

# Create the manifest for the module
- template: Sbom.yml@ComplianceRepo
parameters:
BuildDropPath: $(signOutPath)
Build_Repository_Uri: 'https://github.com/powershell/PSScriptAnalyzer'

# now create the nupkg which we will use to publish the module
# to the powershell gallery (not part of this yaml)
- pwsh: |
Set-Location "$(Build.SourcesDirectory)/OSS_Microsoft_PSSA"
./build -BuildNupkg -signed
./build -BuildNupkg -CopyManifest -signed
displayName: Create nupkg for publishing

# finally publish the parts of the build which will be used in the next stages
Expand Down
6 changes: 6 additions & 0 deletions build.ps1
This file contains hidden or 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
Expand Up @@ -42,6 +42,9 @@ param(
[Parameter(ParameterSetName='Package')]
[switch] $BuildNupkg,

[Parameter(ParameterSetName='Package')]
[switch] $CopyManifest,

[Parameter(ParameterSetName='Package')]
[switch] $Signed

Expand Down Expand Up @@ -92,6 +95,9 @@ END {
return
}
"Package" {
if($CopyManifest) {
Copy-Manifest -signed:$Signed
}
Start-CreatePackage -signed:$Signed
}
"Test" {
Expand Down
27 changes: 27 additions & 0 deletions build.psm1
This file contains hidden or 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
Expand Up @@ -767,6 +767,32 @@ function Copy-CrossCompatibilityModule
}
}

# copy the manifest into the module if is present
function Copy-Manifest
{
param ( [switch]$signed )
if ( $signed ) {
$buildRoot = "signed"
}
else {
$buildRoot = "out"
}
$analyzerVersion = Get-AnalyzerVersion
# location where analyzer goes
# debugging
(Get-ChildItem -File -Recurse)|ForEach-Object {Write-Verbose -Verbose -Message $_}
$modBaseDir = [io.path]::Combine($projectRoot,${buildRoot},"${analyzerName}", $analyzerVersion)
# copy the manifest files
Push-Location $buildRoot
if ( Test-Path _manifest ) {
Copy-Item -Recurse -Path _manifest -Destination $modBaseDir -Verbose
}
else {
Write-Warning -Message "_manifest not found in $PWD"
}
Pop-Location
}

# creates the nuget package which can be used for publishing to the gallery
function Start-CreatePackage
{
Expand All @@ -783,6 +809,7 @@ function Start-CreatePackage
$nupkgDir = Join-Path $PSScriptRoot $buildRoot
$null = Register-PSRepository -Name $repoName -InstallationPolicy Trusted -SourceLocation $nupkgDir
Push-Location $nupkgDir

Publish-Module -Path $PWD/PSScriptAnalyzer -Repository $repoName
}
finally {
Expand Down

Back | FazBrowse Home | New Git URL