semantic-release-cli
setup automated semver compliant package publishing
Last updated 7 years ago by semantic-release-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install semantic-release-cli -g
SYNC missed versions from official npm registry.

semantic-release-cli

Build Status

Install

npm install -g semantic-release-cli

cd your-module
semantic-release-cli setup

dialogue

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
--circle-token=<String> CircleCI auth token
--npm-username=<String>  npm username

Aliases:
  init                 setup

What it Does

semantic-release-cli performs the following steps:

  1. 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
    • 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.)
  2. npm Add User
    • Runs npm adduser with the npm information provided to generate a .npmrc
    • Parses the npm token from the .npmrc for future use
  3. Uses user supplied GitHub Personal Access Token (with the following permissions: repo, read:org, repo:status, repo_deployment, user:email, write:repo_hook)
    • Sets GitHub Personal Access Token in user choosen CI/CD environment variable
  4. Update your package.json
    • Set version field to 0.0.0-development (semantic-release will set the version for you automatically)
    • Add a semantic-release script: "semantic-release": "semantic-release"
    • Add semantic-release as a devDependency
    • Add or overwrite the repository field

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:

  1. Overwrite your .travis.yml file
    • after_success: npm install -g travis-deploy-once and travis-deploy-once "npm run semantic-release": run semantic-release exactly once after all builds pass
    • Set other sane defaults: cache: directories: ~/.npm, notifications: email: false
  2. Login to Travis CI to configure the package. This step requires your module to define a valid, case-sensitive repository field.
    • Enable builds of your repo
    • Add GH_TOKEN and NPM_TOKEN environment variables in the settings

CircleCI

For CircleCI, semantic-release-cli performs the following additional steps:

  1. Create minimal config.yml file (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
  1. Login to CircleCI to configure the package
    • Enable builds of your repo
    • Add GH_TOKEN and NPM_TOKEN environment variables in the settings

Github Actions

For Github Actions, semantic-release-cli performs the following additional step:

  • Login to Github to configure the package
  • Add NPM_TOKEN environment variables as a secret in the settings

For now you will have to manually modify your existing workflow to add a release step. Here is an example of a small complete workflow .github/workflows/workflow.yml:

name: CI
on: push
jobs:
  test:
    runs-on: ubuntu-16.04
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: '12'
      - run: npm ci
      - run: npm test
      - name: Release
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: npx semantic-release

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>.

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

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

Current Tags

  • 5.4.6                                ...           latest (a year ago)

80 Versions

  • 5.4.6                                ...           a year ago
  • 5.4.5                                ...           a year ago
  • 5.4.4                                ...           3 years ago
  • 5.4.3                                ...           4 years ago
  • 5.4.2                                ...           4 years ago
  • 5.4.1                                ...           4 years ago
  • 5.4.0                                ...           4 years ago
  • 5.3.1                                ...           4 years ago
  • 5.3.0                                ...           5 years ago
  • 5.2.3                                ...           5 years ago
  • 5.2.2                                ...           5 years ago
  • 5.2.1                                ...           5 years ago
  • 5.2.0                                ...           5 years ago
  • 5.1.3                                ...           5 years ago
  • 5.1.2                                ...           5 years ago
  • 5.1.1                                ...           5 years ago
  • 5.1.0                                ...           6 years ago
  • 5.0.0                                ...           6 years ago
  • 4.1.2                                ...           6 years ago
  • 4.1.1                                ...           6 years ago
  • 4.1.0                                ...           6 years ago
  • 4.0.13                                ...           6 years ago
  • 4.0.12                                ...           6 years ago
  • 4.0.11                                ...           6 years ago
  • 4.0.10                                ...           6 years ago
  • 4.0.9                                ...           6 years ago
  • 4.0.8                                ...           6 years ago
  • 4.0.7                                ...           6 years ago
  • 4.0.6                                ...           6 years ago
  • 4.0.5                                ...           6 years ago
  • 4.0.4                                ...           6 years ago
  • 4.0.3                                ...           6 years ago
  • 4.0.2                                ...           6 years ago
  • 4.0.1                                ...           7 years ago
  • 4.0.0                                ...           7 years ago
  • 3.6.7                                ...           7 years ago
  • 3.6.6                                ...           7 years ago
  • 3.6.5                                ...           7 years ago
  • 3.6.4                                ...           7 years ago
  • 3.6.3                                ...           7 years ago
  • 3.6.2                                ...           7 years ago
  • 3.6.1                                ...           7 years ago
  • 3.6.0                                ...           7 years ago
  • 3.5.0                                ...           7 years ago
  • 3.4.0                                ...           7 years ago
  • 3.3.1                                ...           7 years ago
  • 3.3.0                                ...           7 years ago
  • 3.2.6                                ...           7 years ago
  • 3.2.5                                ...           7 years ago
  • 3.2.4                                ...           7 years ago
  • 3.2.3                                ...           7 years ago
  • 3.2.2                                ...           7 years ago
  • 3.2.1                                ...           7 years ago
  • 3.2.0                                ...           7 years ago
  • 3.1.0                                ...           7 years ago
  • 3.0.3                                ...           8 years ago
  • 3.0.2                                ...           8 years ago
  • 3.0.1                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.4.1                                ...           9 years ago
  • 1.4.0                                ...           9 years ago
  • 1.3.3                                ...           9 years ago
  • 1.3.2                                ...           9 years ago
  • 1.3.1                                ...           9 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.0                                ...           9 years ago
  • 1.1.5                                ...           9 years ago
  • 1.1.4                                ...           9 years ago
  • 1.1.3                                ...           9 years ago
  • 1.1.2                                ...           9 years ago
  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.5                                ...           9 years ago
  • 1.0.4                                ...           9 years ago
  • 1.0.3                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Downloads
Total 36
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (26)
Dev Dependencies (11)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE