Skip to content

Commit

Permalink
Add package filter parameter for release (#7445)
Browse files Browse the repository at this point in the history
* Add package filter parameter to select recursively found packages in release

* Handle empty value for packageFilter
  • Loading branch information
benbp authored Jan 11, 2024
1 parent 79497aa commit 13ff660
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
ArtifactLocation: 'not-specified'
PackageRepository: 'not-specified'
PackageFilter: ''
ReleaseSha: 'not-specified'
RepoId: $(Build.Repository.Name)
WorkingDirectory: ''
Expand All @@ -14,10 +15,11 @@ steps:
arguments: >
-artifactLocation ${{ parameters.ArtifactLocation }}
-packageRepository ${{ parameters.PackageRepository }}
-packageFilter "${{ parameters.PackageFilter }}"
-releaseSha ${{ parameters.ReleaseSha }}
-repoId ${{ parameters.RepoId }}
-workingDirectory '${{ parameters.WorkingDirectory }}'
pwsh: true
timeoutInMinutes: 5
env:
GH_TOKEN: $(azuresdk-github-pat)
GH_TOKEN: $(azuresdk-github-pat)
6 changes: 6 additions & 0 deletions eng/common/scripts/create-tags-and-git-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ param (
$artifactLocation, # the root of the artifact folder. DevOps $(System.ArtifactsDirectory)
$workingDirectory, # directory that package artifacts will be extracted into for examination (if necessary)
$packageRepository, # used to indicate destination against which we will check the existing version.
$packageFilter,
# valid options: PyPI, Nuget, NPM, Maven, C, CPP
# used by CreateTags
$releaseSha, # the SHA for the artifacts. DevOps: $(Release.Artifacts.<artifactAlias>.SourceVersion) or $(Build.SourceVersion)
Expand All @@ -26,6 +27,11 @@ Write-Host "Using API URL $apiUrl"
# VERIFY PACKAGES
$pkgList = VerifyPackages -artifactLocation $artifactLocation -workingDirectory $workingDirectory -apiUrl $apiUrl -releaseSha $releaseSha -continueOnError $continueOnError

if ($packageFilter) {
Write-Host "Filtering discovered packages to '$packageFilter'"
[array]$pkgList = $pkgList | Where-Object { $_.PackageId -like $packageFilter }
}

if ($pkgList) {
Write-Host "Given the visible artifacts, github releases will be created for the following:"

Expand Down

0 comments on commit 13ff660

Please sign in to comment.