-
Notifications
You must be signed in to change notification settings - Fork 8
PublishNodeModule Task
The PublishNodeModule
task runs npm publish
in the current working directory. We recommend using this task instead of the Npm
task because this task handles credentials needed to publish to an NPM repository as securely as possible. Just before it publishes, it base-64 encodes the password, saves it to an .npmrc
file in the task working directory (this is what NPM wants/expects). After the build, it removes the file. It also runs the npm version
command to update your package's version to the version of the current build (Whiskey 0.43.0 and later), including prerelease information. Use Whiskey's Version task to set prerelease information for your build. When publishing a prerelease version, the task will publish the module with the Whiskey variable WHISKEY_SEMVER2_PRERELEASE_ID
(Variables) as the distribution tag.
Use the Tag
property (Whiskey 0.43.0 and later) to publish the module with a specific distribution tag.
It also runs npm prune
before publishing.
This task will install the latest LTS version of Node into a .node
directory (in the same directory as your whiskey.yml file). To use a specific version, set the engines.node
property in your package.json file to the version you want. (See https://docs.npmjs.com/files/package.json#engines for more information.)
-
NpmRegistryUri
(mandatory): the URI to the registry where the module should be published. -
CredentialID
(mandatory): the credential to use when publishing. Credentials are added to your build with theAdd-WhiskeyCredential
function. ThisCredentialID
property should be the same value as theID
parameter used when adding the credential withAdd-WhiskeyCredential
. -
EmailAddress
(mandatory): the email address to use when publishing. -
Tag
(Added in 0.43.0): the distribution tag to use when publishing the module.
Build:
- PublishNodeModule
Demonstrates how to publish the Node module located in the same directory as your whiskey.yml file
Build:
- PublishNodeModule:
WorkingDirectory: 'app'
Demonstrates how to publish a Node module that isn't in the same directory as your whiskey.yml file. In this example, the Node module in the app
directory is published (app
is resolved relative to your whiskey.yml file).
Build:
- PublishNodeModule:
Tag: mycutomtag
Demonstrates how to publish the Node module with the distribution tag mycutomtag
.
- Common Task Properties
- AppVeyorWaitForBuildJob
- CopyFile
- Delete
- DotNet
- Exec
- File
- GetPowerShellModule
- GitHubRelease
- InstallNodeJs
- LoadTask
- Log
- MergeFile
- MSBuild
- NuGetPack
- NuGetPush
- NuGetRestore
- NUnit2
- NUnit3
- Parallel
- Pester
- Pipeline
- PowerShell
- ProGetUniversalPackage
- PublishBitbucketServerTag
- PublishBuildMasterPackage
- PublishNodeModule
- PublishPowerShellModule
- PublishProGetAsset
- PublishProGetUniversalPackage
- SetVariable
- SetVariableFromPowerShellDataFile
- SetVariableFromXml
- TaskDefaults
- Version
- Zip