* Added optional artifact list to filter the package info to be returned * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * return full package info if the input artifact list is empty * Fixed hashset issue * Added artifacts parameter --------- Co-authored-by: ray chen <raychen@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
28 lines
1.2 KiB
YAML
28 lines
1.2 KiB
YAML
# This script fragment is used across our repos to set a variable "SetDevVersion" which
|
|
# is used when this pipeline is going to be generating and publishing daily dev builds.
|
|
parameters:
|
|
ServiceDirectory: ''
|
|
Artifacts: []
|
|
Condition: succeeded()
|
|
steps:
|
|
- ${{if ne(parameters.ServiceDirectory, '')}}:
|
|
- task: Powershell@2
|
|
inputs:
|
|
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
|
|
arguments: >
|
|
-ServiceDirectory ${{parameters.ServiceDirectory}}
|
|
-OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
|
|
-artifactList @('${{ replace(convertToJson(parameters.Artifacts), '''', '`''') }}' | ConvertFrom-Json | Select-Object -ExpandProperty name)
|
|
pwsh: true
|
|
workingDirectory: $(Pipeline.Workspace)
|
|
displayName: Dump Package properties
|
|
condition: ${{ parameters.Condition }}
|
|
- pwsh: |
|
|
$setDailyDevBuild = "false"
|
|
if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) {
|
|
$setDailyDevBuild = "true"
|
|
}
|
|
echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild"
|
|
displayName: "Setup Versioning Properties"
|
|
condition: and(${{ parameters.Condition }}, eq(variables['SetDevVersion'], ''))
|