This plugin hooks up gradle-node-plugin with nebula-release-plugin to make semver 2 versioned npm releases easier.
build.gradle
plugins {
id 'net.wooga.node-release' version '2.+'
}
- Applies com.github.node-gradle
- Expects a valid
package.json
on project root. - Expects
clean
,test
andbuild
task inscripts
block ofpackage.json
- Expects existence of a git repository with remote origin
build.gradle
plugins {
id 'net.wooga.node-release' version '0.1.0'
}
github {
respositoryName = 'wooga/wdk-js-MyPackage'
}
nodeRelease {
npmUser = 'username'
npmPass = 'password'
npmAuthUrl = 'https://wooga.artifactoryonline.com/wooga/api/npm/atlas-node/auth/wooga'
}
project.npmSetup.dependsOn ensureNpmrc
Run on of the release tasks defined by nebular.release: devSnapshot
, snapshot
, candidate
or release
This task type can be used to create a npm configuration file (.npmrc
). By default ensureNpmrc
is not hooked up to any lifecycle or release related tasks. If you in need of this task, please hook it up yourself or create your own instance.
Example Configuration:
task example (type:wooga.gradle.node.tasks.NpmCredentialsTask) {
npmUser = 'username'
npmPass = 'password'
npmAuthUrl = 'https://wooga.artifactoryonline.com/wooga/api/npm/atlas-node/auth/wooga'
}
you can optionally set npmrcFile
to define the target location. By default it's set to project root
Environment Variables:
wooga.gradle.node.tasks.NpmCredentialsTask
properties can also be set by environment variables:
NODE_RELEASE_NPM_USER
npm usernameNODE_RELEASE_NPM_PASS
npm passwordNODE_RELEASE_NPM_AUTH_URL
npm authentication url
npmrc file:
// set npmrc to system level
nodeRelease {
npmrc = file('~/.npmrc')
}
github
github {
respositoryName = 'wooga/wdk-js-MyPackage'
}
In order to enable github releases, we have to define the target repository.
Copyright 2018 Wooga GmbH
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.