azuremycry
azuremycry

Reputation: 122

Azure DevOps pipeline - custom name of output file

I would like to ask you if it possible to create a custom name of zip file using output argument in in yaml task : DotNetCoreCLI@2

My yaml code:

- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: true
    projects: '**/XXXProject.csproj'
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)/newzipname'
    zipAfterPublish: true

Current output:

../newzipname/XXXProject.zip

What I would like to achieve:

../newzipname.zip

Thanks in advance for all answers.

Upvotes: 2

Views: 2559

Answers (1)

pavelsaman
pavelsaman

Reputation: 8322

It doesn't seem to be supported in DotNetCoreCLI task.

Another option is to add PowerShell task and rename the .zip file produced by DotNetCoreCLI task. You can use Rename-Item PowerShell command for that.

Upvotes: 1

Related Questions