Skip to content

This plugin provides opinions and tasks for the release process of npm packages.

License

Notifications You must be signed in to change notification settings

wooga/atlas-node-release

Repository files navigation

atlas-node-release

Build Status Test GitHub contributors GitHub language GitHub tag GitHub release GitHub commits since latest Github issues Github closed issues GitHub pull requests GitHub closed pull requests

This plugin hooks up gradle-node-plugin with nebula-release-plugin to make semver 2 versioned npm releases easier.

Applying the plugin

build.gradle

plugins {
    id 'net.wooga.node-release' version '2.+'
}

Conventions

  • Applies com.github.node-gradle
  • Expects a valid package.json on project root.
  • Expects clean, test and build task in scripts block of package.json
  • Expects existence of a git repository with remote origin

Documentation

Usage

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

NpmCredentialsTask

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 username
  • NODE_RELEASE_NPM_PASS npm password
  • NODE_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.

LICENSE

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.