Skip to content

Commit 1ae9698

Browse files
azure-sdkbenbp
andauthored
Sync eng/common directory with azure-sdk-tools for PR 7445 (#22233)
* Add package filter parameter to select recursively found packages in release * Handle empty value for packageFilter --------- Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent c99ab58 commit 1ae9698

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

eng/common/pipelines/templates/steps/create-tags-and-git-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
parameters:
22
ArtifactLocation: 'not-specified'
33
PackageRepository: 'not-specified'
4+
PackageFilter: ''
45
ReleaseSha: 'not-specified'
56
RepoId: $(Build.Repository.Name)
67
WorkingDirectory: ''
@@ -14,10 +15,11 @@ steps:
1415
arguments: >
1516
-artifactLocation ${{ parameters.ArtifactLocation }}
1617
-packageRepository ${{ parameters.PackageRepository }}
18+
-packageFilter "${{ parameters.PackageFilter }}"
1719
-releaseSha ${{ parameters.ReleaseSha }}
1820
-repoId ${{ parameters.RepoId }}
1921
-workingDirectory '${{ parameters.WorkingDirectory }}'
2022
pwsh: true
2123
timeoutInMinutes: 5
2224
env:
23-
GH_TOKEN: $(azuresdk-github-pat)
25+
GH_TOKEN: $(azuresdk-github-pat)

eng/common/scripts/create-tags-and-git-release.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ param (
77
$artifactLocation, # the root of the artifact folder. DevOps $(System.ArtifactsDirectory)
88
$workingDirectory, # directory that package artifacts will be extracted into for examination (if necessary)
99
$packageRepository, # used to indicate destination against which we will check the existing version.
10+
$packageFilter,
1011
# valid options: PyPI, Nuget, NPM, Maven, C, CPP
1112
# used by CreateTags
1213
$releaseSha, # the SHA for the artifacts. DevOps: $(Release.Artifacts.<artifactAlias>.SourceVersion) or $(Build.SourceVersion)
@@ -26,6 +27,11 @@ Write-Host "Using API URL $apiUrl"
2627
# VERIFY PACKAGES
2728
$pkgList = VerifyPackages -artifactLocation $artifactLocation -workingDirectory $workingDirectory -apiUrl $apiUrl -releaseSha $releaseSha -continueOnError $continueOnError
2829

30+
if ($packageFilter) {
31+
Write-Host "Filtering discovered packages to '$packageFilter'"
32+
[array]$pkgList = $pkgList | Where-Object { $_.PackageId -like $packageFilter }
33+
}
34+
2935
if ($pkgList) {
3036
Write-Host "Given the visible artifacts, github releases will be created for the following:"
3137

0 commit comments

Comments
 (0)