Search code examples
azure-devopsyamlazure-pipelinesazure-artifacts

How to archive a folder as tar.bz2 file and upload to universal packages from Azure Artifacts


The following code is for archive, but how to upload the archived tar.bz2 to a universal packages from Azure Artifacts

- task: ArchiveFiles@2
  inputs:
    #rootFolderOrFile: '$(Build.BinariesDirectory)' 
    #includeRootFolder: true 
    #archiveType: 'tar' 
    #tarCompression: 'bz2' 
    #archiveFile: '$(Build.ArtifactStagingDirectory)/$(fileName)_$(Build.BuildId).tar.bz2' 
    #replaceExistingArchive: true 
    #verbose: # Optional
    #quiet: # Optional

Solution

  • To publish a Universal Package to your feed, add the following snippet to your azure-pipelines.yml file.

    - task: UniversalPackages@0
      displayName: Universal Publish
      inputs:
        command: publish
        publishDirectory: '$(Build.ArtifactStagingDirectory)'
        vstsFeedPublish: '<projectName>/<feedName>'
        vstsFeedPackagePublish: '<Package name>'
        versionOption: custom
        versionPublish: '<Package version>'
        packagePublishDescription: '<Package description>'
    

    By default, the Universal Packages task will publish all files in$(Build.ArtifactStagingDirectory). To prepare your Universal Package for publishing, either configure preceding tasks to place output files in that directory, or use the Copy Files utility task to assemble the files that you want to publish.

    For details ,please refer to this official document.