0

Is it possible to promote an npm package in TFS to release or prerelease through Javascript (node scripts: npm run npm-publish)?

We have a custom process where we publish library packages to our TFS feed. We also want to put packages in release view or prerelease view (for alpha and beta).

Here the explanation how to do this through the user interface: https://learn.microsoft.com/en-us/vsts/package/feeds/views?view=vsts

Community
  • 1
  • 1
stephan.peters
  • 963
  • 13
  • 35

1 Answers1

0

You can promote package through REST API:

PATCH https://{account}.pkgs.visualstudio.com/DefaultCollection/_apis/packaging/feeds/{feedId}/nuget/packages/{packageId}/versions/{packageVersion}?api-version=5.0-preview.1

application/json:

{  "views":     { "op":"add", 
     "path":"/views/-", 
     "value":"release view" }  }

Related article: VSTS - unpromote a package version from release view

So, just send the HTTP request to that REST API endpoint through Nodejs.

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53