Add an option to publish a .tgz previously packed with `npm pack`
See original GitHub issueHello,
I use VSTS to build and publish a NPM package.
I have a CI build which restores packages, executes the build scripts, runs npm pack
and upload the .tgz file as an artifact. Then, I have a release definition which is responsible for deploying the package in VSTS Package Management, MyGet, or nmpjs public registry depending on the stability.
The npm pack
command creates a .tgz file with the package name and the version, so it is not possible to predict the final file name.
However, the arguments
input of the NPM task does not support minimatch patterns.
Plus, the working folder
input is not necessary anymore in this mode (and should be let empty, or the task would fail with the error “TypeError: Cannot read property ‘trim’ of null”).
I think it would be great if we could choose either to publish a folder (and let the working folder
input as is) or to publish a tarball (and add an input that supports minimatch for this purpose).
As a temporary fix, I currently extract the tarball and then call the NPM publish task with the working folder
set.
Thank you!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:13
- Comments:11 (6 by maintainers)
Hi,
The key part of my scenario is that I have two different pipelines: a build definition which creates the package (with the
npm pack
command), and a release definition which deploys the same package to different registries.Build definition
Create the package
Copy it in the build artifacts
Release definition
Pipeline
I cannot use the preconfigured publish command
I cannot use the custom command
The minimatch pattern is not resolved, and I cannot select the external npm registry.
My temporary fix
So, at the moment, I can only extract the package and then publish it. Yes, it IS odd! 😅 That’s why I opened this issue to ask if you could add an option to the preconfigured publish command
Hope it’s clearer now! Thanks!
Closing this as WF. In the upcoming quarter, we’ll be moving away from the full-featured Artifacts-related tasks and recommending calling npm directly, which will give you the flexibility to call whatever command you wish, even if you’re working against an authenticated feed. See the design here for more details.