JSPM

  • Created
  • Published
  • Downloads 5720
  • Score
    100M100P100Q123458F
  • License MIT

setup automated semver compliant package publishing

Package Exports

  • semantic-release-cli

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (semantic-release-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

semantic-release-cli

Build Status Coverage Status Dependency Status devDependency Status js-standard-style

NPM NPM

Automated semantic-release setup

npm install -g semantic-release-cli

cd your-module
semantic-release-cli setup

dialogue

Manual Setup

This is what you would have to if semantic-release-cli wouldn't exist:

package.json

Delete the version field from your package.json. Really. It's safe to do, because machines will take care of it from now on.

Install semantic-release and save it as a devDependency.

# stable channel
npm install --save-dev semantic-release

# master channel
npm install --save-dev semantic-release@master

Create a semantic-release script in the scripts field of your package.json.

{
  "scripts": {
    "semantic-release": "semantic-release pre && npm publish && semantic-release post"
  }
}

Add a repository field to the package.json. You should do this anyway, but – as semantic-release depends on it – now you have to.

CI Server

The idea is that your CI Server runs npm run semantic-release whenever a test run on your main branch succeeds. By default these conditions are verified assuming a Travis CI environment. This isn't tied to a specific service though. Using the verifyConditions plugin you can easily configure your own CI Server.

The CI environment has to export CI=true in order for semantic-release to not automatically perform a dry run. Most CI services do this by default.

You need to export access tokens to the environment, so semantic-release can authenticate itself with GitHub and npm. Get a token for GitHub on their website, grant it the repo/public_repo scope, and export it as GH_TOKEN. The smoothest and securest way to do this on Travis CI is to use their web interface.

Unfortunately there is no web interface for obtaining npm tokens yet, so you have to run npm adduser locally. Copy the token from your ~/.npmrc file afterwards. Export it as NPM_TOKEN.

License

MIT License 2015 © Christoph Witzko and contributors

https://twitter.com/trodrigues/status/509301317467373571