1
votes

Snippet from Yaml file of my pipeline where I archive the build directory, publish it to artifacts and then try to make the artifact available as a universal package in 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'

I have create a feed in the Azure Artifacts named "MCU_Package". But when run the file I get this error:

{"@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"}

What is wrong here ?

1

1 Answers

3
votes

The package name can't contain uppercase characters.

- 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'