I have added a npm-step in my release-pipeline to get currently latest package version for a beta build like this:
- task: Npm@1
displayName: 'Get current published beta-version'
inputs:
command: custom
workingDir: ./packages/package
verbose: false
customCommand: 'show somepackagename@beta version'
customRegistry: useFeed
customFeed: '<someguids>'
This prints the latest version with the beta-tag, but I have not found a way to persist this value to the next step in my pipeline. I have tried adding things like > version.txt
, | Out-File version.txt
etc to the end of the customCommand, but it escapes both with double quotes and it is not executed. Any ideas if it is possible to achieve this with the current npm-task, or do I have to set up NPM registry authentication manually with .npmrc (the package is private in azure artifacts)?
Check the solution in the following case Is there a way to log the output of npm install command to see whether it works for you: