1

来自我的管道的 Yaml 文件的片段,我在其中存档构建目录,将其发布到工件,然后尝试使工件作为 Azure Artifacts 中的通用包可用。

- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: '$(Build.SourcesDirectory)/Software/MCU/build/pkgs'
    archiveType: 'zip'
    archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)'
    artifactName: MCU_Build

- task: UniversalPackages@0
  inputs:
    command: 'publish'
    publishDirectory: '$(Build.ArtifactStagingDirectory)'
    feedsToUsePublish: 'internal'
    vstsFeedPublish: '354355534-bcc1-4c84-935e-19d399d1a6be/4dff5f18-2cc7-4a5b-bfb1-307e59c7de32'
    vstsFeedPackagePublish: 'MCU_Build'
    versionOption: 'major'
    packagePublishDescription: 'MCU Package'

我在 Azure Artifacts 中创建了一个名为“MCU_Package”的提要。但是当运行文件时我得到这个错误:

{"@t":"2020-05-28T03:24:49.6036932Z","@m":"**The package name provided is invalid**. Universal package names must be one or more lowercase alphanumeric segments separated by a dash, dot or underscore. The package name must be under 256 characters.","@i":"69c271d4","@l":"Error","SourceContext":"ArtifactTool.Program","UtcTimestamp":"2020-05-28 03:24:49.603Z"}

[error]Error: An unexpected error occurred while trying to push the package. Exit code(20) and error({"@t":"2020-05-28T03:24:33.6970608Z","@m":"ApplicationInsightsTelemetrySender will correlate events with X-TFS-Session 4d177101-a80f-4f0d-abd7-c677a260475e","@i":"019a973c","SourceContext":"ArtifactTool.Commands.UPackPublishCommand","UtcTimestamp":"2020-05-28 03:24:33.697Z"}

这里有什么问题?

4

1 回答 1

3

包名不能包含大写字符。

- task: UniversalPackages@0
  inputs:
    command: 'publish'
    publishDirectory: '$(Build.ArtifactStagingDirectory)'
    feedsToUsePublish: 'internal'
    vstsFeedPublish: '354355534-bcc1-4c84-935e-19d399d1a6be/4dff5f18-2cc7-4a5b-bfb1-307e59c7de32'
    vstsFeedPackagePublish: 'mcu-build'
    versionOption: 'major'
    packagePublishDescription: 'MCU Package'
于 2020-05-28T19:12:35.627 回答