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
Install
npm install -g semantic-release-cli
cd your-module
semantic-release-cli setup
Options
Usage:
semantic-release-cli setup [options]
Options:
-h --help Show this screen.
-v --version Show version.
--[no-]keychain Use keychain to get passwords [default: true].
--ask-for-passwords Ask for the passwords even if passwords are stored [default: false].
--tag=<String> npm tag to install [default: 'latest'].
--gh-token=<String> GitHub auth token
--npm-token=<String> npm auth token
--gh-username=<String> GitHub username
--npm-username=<String> npm username
Aliases:
init setupWhat it Does
semantic-release-cli performs the following steps:
- Asks for the information it needs. You will need to provide it with:
- Whether your GitHub repository is public or private
- Which npm registry you want to use (Default: https://registry.npmjs.org/)
- Your npm username (unless passwords were previously saved to keychain)
- Your npm email
- Your npm password
- Your GitHub username
- Your GitHub password (unless passwords were previously saved to keychain)
- Which continuous integration system you want to use. (Options: Travis CI / Pro / Enterprise / CircleCI, or Other)
- [Travis only] Whether you want to test a single node.js version (e.g. - 8) or multiple node.js versions (e.g. - 4, 6, 8, etc.)
- npm Add User
- Runs
npm adduserwith the npm information provided to generate a.npmrc - Parses the npm token from the
.npmrcfor future use
- Runs
- Create GitHub Personal Token
- Logs into GitHub using the username and password provided
- Creates (and saves for later use) a GitHub Personal Access Token with the following permissions: repo, read:org, repo:status, repo_deployment, user:email, write:repo_hook
- Update your
package.json- Set
versionfield to0.0.0-development(semantic-releasewill set the version for you automatically) - Add a
semantic-releasescript:"semantic-release": "semantic-release" - Add
semantic-releaseas adevDependency - Add or overwrite the
repositoryfield
- Set
Travis CI
Versions 4.1.0+
semantic-release-cli does not perform any additional Travis-specific steps, but the cli output will provide a link for assistance integrating Travis and semantic-release-cli.
Prior to version 4.1.0
semantic-release-cli performs the following additional steps:
- Overwrite your
.travis.ymlfileafter_success:npm install -g travis-deploy-onceandtravis-deploy-once "npm run semantic-release": runsemantic-releaseexactly once after all builds pass- Set other sane defaults:
cache: directories: ~/.npm,notifications: email: false
- Login to Travis CI to configure the package. This step requires your module to define a valid, case-sensitive
repositoryfield.- Enable builds of your repo
- Add
GH_TOKENandNPM_TOKENenvironment variables in the settings
CircleCI
For CircleCI, semantic-release-cli performs the following additional steps:
- Create minimal
config.ymlfile (if CircleCI was selected)
version: 2
jobs:
build:
docker:
- image: 'circleci/node:latest'
steps:
- checkout
- run:
name: install
command: npm install
- run:
name: release
command: npm run semantic-release || true- Login to CircleCI to configure the package
- Enable builds of your repo
- Add
GH_TOKENandNPM_TOKENenvironment variables in the settings
Other CI Servers
By default, semantic-release-cli supports the popular Travis CI and CircleCI servers. If you select Other as your server during configuration, semantic-release-cli will print out the environment variables you need to set on your CI server. You will be responsible for adding these environment variables as well as configuring your CI server to run npm run semantic-release after all the builds pass.
Note that your CI server will also need to set the environment variable CI=true so that semantic-release will not perform a dry run. (Most CI services do this by default.) See the semantic-release documentation for more details.
Setting defaults
This package reads your npm username from your global .npmrc. In order to autosuggest a username in the future, make sure to set your username there: npm config set username <username>.
It also reads your GitHub username from your global .gitconfig. In order to autosuggest a username in the future, run git config --global --add github.username <username>. If a name isn't defined here, it will default to using your npm username, as it will assume they are identical.
Contribute
Please contribute! We welcome issues and pull requests.
When committing, please conform to the semantic-release commit standards.
License
MIT License 2015 © Christoph Witzko and contributors
