azure-devops-yaml-schema
azure-devops-yaml-schema copied to clipboard
DownloadPackage@1 - incomplete documentation for version
The documentation for the version input is wrong with regards to downloading latest version of a universal package.
Current docs:
Specifies the version of the package. Use latest to download the latest version of the package at runtime.
This fails when trying to download a universal package:
- task: DownloadPackage@1
inputs:
packageType: upack
feed: feed
definition: packagename
version: latest
C:\hostedtoolcache\windows\ArtifactTool\0.2.304\x64\ArtifactTool.exe universal download [omitted] --package-version latest [omitted]
{"@t":"2024-01-25T13:24:19.5521953Z","@m":"The package version provided is invalid. Universal package versions must be lowercase SemVer 2.0 versions without build metadata. The package version must be under 128 characters, and major/minor/patch must each be less than or equal to 2147483647.","@i":"67cc01dd","@l":"Error","SourceContext":"ArtifactTool.Program","UtcTimestamp":"2024-01-25 13:24:19.552Z"}
##[error]An unexpected error occurred while trying to download the package. Exit code(20) and error({"@t":"2024-01-25T13:24:19.5521953Z","@m":"The package version provided is invalid. Universal package versions must be lowercase SemVer 2.0 versions without build metadata. The package version must be under 128 characters, and major/minor/patch must each be less than or equal to 2147483647.","@i":"67cc01dd","@l":"Error","SourceContext":"ArtifactTool.Program","UtcTimestamp":"2024-01-25 13:24:19.552Z"})
According to docs, the proper way of downloading the latest version of a universal package is to specify --version '*'. This works:
- task: DownloadPackage@1
inputs:
packageType: upack
feed: feed
definition: packagename
version: '*'
C:\hostedtoolcache\windows\ArtifactTool\0.2.304\x64\ArtifactTool.exe universal download [omitted] --package-version * [omitted]
{"Version":"0.0.1",[omitted],"PackageSize":316794088}
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 769d848b-315d-86bf-1673-5a87f87a970d
- Version Independent ID: 769d848b-315d-86bf-1673-5a87f87a970d
- Content: DownloadPackage@1 - Download package v1 task
- Content Source: task-reference/download-package-v1.md
- Service: azure-devops-pipelines
- Sub-service: azure-devops-pipelines-tasks
- GitHub Login: @steved0x
- Microsoft Alias: sdanie