1.2.0 • Published 4 years ago

@woopidi/semantic-release v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Semantic Release

This makes life easier to setup semantic release on your package.

1. Install

npm i -D @woopidi/semantic-release

2. Modify package.json file

Add a semantic release cli command to trigger the release

"scripts": : {
	"release": "semantic-release",
	"commit": "commitizen"
}

Change your package version to something like this:

"version": "0.0.0-semantic-versioning"

Add the husky hooks to your package file:

"husky": {
    "hooks": {
      "commit-msg": "commitlint -E  HUSKY_GIT_PARAMS"
    }
}

3. Add the .releaserc.json in your root directory

{
	"branches": [
		"master"
	],
	"plugins": [
		"@semantic-release/commit-analyzer",
		"@semantic-release/release-notes-generator",
		[
			"@semantic-release/gitlab",
			{
				"gitlabUrl": "<GITLAB_SERVER_URL>"
			}
		]
	]
}

4. Add the commitlint.config.js in your root directory

module.exports = {
	extends: [
		"@commitlint/config-conventional"
	],
	rules: {
		"subject-case": [
			2,
			"never",
			[
				"start-case",
				"pascal-case"
			]
		]
	}
}

5. Tag your initial version manually

npm tag v1.0.0 <LOG_HASH_GOES_HERE>
npm push origin v1.0.0

6. Finally you can run the release

npm run release