Skip to content

Commit c51934e

Browse files
Fix APIScan by providing the required parameters
1 parent 392e5b5 commit c51934e

File tree

3 files changed

+35
-28
lines changed

3 files changed

+35
-28
lines changed

tools/releaseBuild/yaml/nuget.yml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,7 @@ steps:
6565
inputs:
6666
versionSpec: 5.3.1
6767

68-
- powershell: |
69-
$Branch = $env:BUILD_SOURCEBRANCH
70-
$branchOnly = $Branch -replace '^refs/heads/';
71-
$branchOnly = $branchOnly -replace '[_\-]'
72-
73-
$packageVersion = if($env:PACKAGE_VERSION -eq 'fromBranch' -or !$env:PACKAGE_VERSION)
74-
{
75-
if($Branch -match '^.*(release[-/])')
76-
{
77-
Write-verbose "release branch:" -verbose
78-
$Branch -replace '^.*(release[-/]v)'
79-
}
80-
else
81-
{
82-
"0.0.0"
83-
}
84-
}
85-
else {
86-
"0.0.0"
87-
}
88-
89-
$vstsCommandString = "vso[task.setvariable variable=NugetPackageVersion]$packageVersion"
90-
Write-Verbose -Message "setting $Variable to $packageVersion" -Verbose
91-
Write-Host -Object "##$vstsCommandString"
92-
93-
displayName: Set NuGetPackageVersion
68+
- template: setVersion.yml
9469

9570
- powershell: |
9671
Import-Module $(Build.SourcesDirectory)\build.psm1
@@ -107,7 +82,7 @@ steps:
10782
$macOSZipPath = Join-Path "$(System.ArtifactsDirectory)/release" 'osx-symbols.zip'
10883
$psrpZipPath = Join-Path "$(System.ArtifactsDirectory)/release" 'psrp.zip'
10984
110-
Start-BuildPowerShellNativePackage -PackageRoot $PackageRoot -Version $(NugetPackageVersion) -WindowsX64ZipPath $WindowsX64ZipPath -WindowsX86ZipPath $WindowsX86ZipPath -WindowsARMZipPath $WindowsARMZipPath -WindowsARM64ZipPath $WindowsARM64ZipPath -LinuxZipPath $LinuxZipPath -LinuxARMZipPath $LinuxARMZipPath -LinuxARM64ZipPath $LinuxARM64ZipPath -LinuxAlpineZipPath $LinuxAlpineZipPath -macOSZipPath $macOSZipPath -psrpZipPath $psrpZipPath -NuGetOutputPath $(NuGetPackagePath)
85+
Start-BuildPowerShellNativePackage -PackageRoot $PackageRoot -Version $(PackageVersion) -WindowsX64ZipPath $WindowsX64ZipPath -WindowsX86ZipPath $WindowsX86ZipPath -WindowsARMZipPath $WindowsARMZipPath -WindowsARM64ZipPath $WindowsARM64ZipPath -LinuxZipPath $LinuxZipPath -LinuxARMZipPath $LinuxARMZipPath -LinuxARM64ZipPath $LinuxARM64ZipPath -LinuxAlpineZipPath $LinuxAlpineZipPath -macOSZipPath $macOSZipPath -psrpZipPath $psrpZipPath -NuGetOutputPath $(NuGetPackagePath)
11186
11287
displayName: 'Build NuGet package'
11388

@@ -152,5 +127,5 @@ steps:
152127
- template: uploadArtifact.yml
153128
parameters:
154129
artifactPath: '$(System.ArtifactsDirectory)\signed'
155-
artifactFilter: 'Microsoft.PowerShell.Native.$(NugetPackageVersion).nupkg'
130+
artifactFilter: 'Microsoft.PowerShell.Native.$(PackageVersion).nupkg'
156131
artifactName: 'finalResults'

tools/releaseBuild/yaml/releaseBuild.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ stages:
110110
- download: current
111111
artifact: signed
112112

113+
- template: setVersion.yml
114+
113115
- powershell: |
114116
$null = New-Item $(PackageRoot) -ItemType Directory -Force -Verbose
115117
if(-not (Test-Path '$(Pipeline.Workspace)/release' ))
@@ -153,6 +155,9 @@ stages:
153155
# tsa-upload
154156
codeBaseName: 'PowerShellNative'
155157
# selections
158+
softwareName: 'PowerShellNative'
159+
softwareNameFolder: '$(Pipeline.Workspace)/uncompressed'
160+
softwareVersionNum: '$(PackageVersion)'
156161
APIScan: true # set to false when not using Windows APIs.
157162

158163
- template: publish.yml
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
steps:
2+
- pwsh: |
3+
$Branch = $env:BUILD_SOURCEBRANCH
4+
$branchOnly = $Branch -replace '^refs/heads/';
5+
$branchOnly = $branchOnly -replace '[_\-]'
6+
7+
$packageVersion = if($env:PACKAGE_VERSION -eq 'fromBranch' -or !$env:PACKAGE_VERSION)
8+
{
9+
if($Branch -match '^.*(release[-/])')
10+
{
11+
Write-verbose "release branch:" -verbose
12+
$Branch -replace '^.*(release[-/]v)'
13+
}
14+
else
15+
{
16+
"0.0.0"
17+
}
18+
}
19+
else {
20+
"0.0.0"
21+
}
22+
23+
$vstsCommandString = "vso[task.setvariable variable=PackageVersion]$packageVersion"
24+
Write-Verbose -Message "setting $Variable to $packageVersion" -Verbose
25+
Write-Host -Object "##$vstsCommandString"
26+
27+
displayName: Set version variable

0 commit comments

Comments
 (0)