@adfinis-sygroup/semantic-release-config

2020-02-14

Shared semantic release configuration for Adfinis SyGroup projects

npm version

semantic-release-config

Sharable configuration for semantic release.

Features

Currently, this config is only a slight modification of the default config:

  • Deploy from releasebranch instead of master
  • Add @semantic-release/gitplugin to publish updated package.jsonto repository after deployment

Installation

Install the npm package

yarn add --dev @adfinis-sygroup/semantic-release-config

and add the following to the extendsproperty of your semantic release configuration:

{
  "extends": "@adfinis-sygroup/semantic-release-config"
}

This repo also contains commitlint. Configure it to check that commit messagesas are formatted according to the conventional commit formatby adding the following to package.json:

"commitlint": {
    "extends": [
      "@commitlint/config-conventional"
    ]
  }

Set up a pre-commit hook to integrate it; e.g. by installing husky:

yarn add husky --dev

and adding the following section to package.json:

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

CI Configuration

  • Add credentials for GitHub and npm as described here
  • Run semantic-release in the deploy stage as described here

Example:

jobs:
  include:
    - stage: release
      if: branch = release and type = push
      node_js: lts/*
      deploy:
        provider: script
        skip_cleanup: true
        script:
          - yarn semantic-release --branch release

Commitizen

Optionally, you can also set up commitizenfor a more interactive way of adding commits:

$ git cz

? Select the type of change that you're committing:
? What is the scope of this change (e.g. component or file name)?
? Write a short, imperative tense description of the change:
? Provide a longer description of the change: (press enter to skip)
? Are there any breaking changes? No
? Does this change affect any open issues? No

Setup is simple:

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

After, run git czinstead of git commit.

Repository

https@github.com:adfinis-sygroup/semantic-release-config


上一篇:@advanced-rest-client/a11y-suite
下一篇:@6river/commitlint-config-6river
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部