Skip to content

Instantly share code, notes, and snippets.

@reneweteling
Created March 22, 2019 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reneweteling/9d97a7a49a555d5a6f3590a100da94aa to your computer and use it in GitHub Desktop.
Save reneweteling/9d97a7a49a555d5a6f3590a100da94aa to your computer and use it in GitHub Desktop.
Automatic commit versioning

Init npm and add semantic-release

npm init
npm add semantic-release --save-dev

Commitizen

npm install commitizen -g
commitizen init cz-conventional-changelog --save-dev --save-exact

Add config to package.json

"release": {
    "branch": "master",
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      "@semantic-release/github"
    ]
  },

CircleCi

Config (add release step)

- run:
    name: Release
    command: |
      npm i
      npx semantic-release

Tokens

  • add a fake NPM_TOKEN to the CircleCi environment
  • add a personal github token to the CircleCi environment GH_TOKEN

Now start committing

Manual

Commit message Release type
fix(pencil): stop graphite breaking when too much pressure applied Patch Release
feat(pencil): add 'graphiteWidth' option Minor Feature Release
perf(pencil): remove graphiteWidth option

BREAKING CHANGE: The graphiteWidth option has been removed.
The default graphite width of 10mm is always used for performance reasons.
Major Breaking Release

Automatic

git cz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment