@adfinis-sygroup/semantic-release-config

Shared semantic release configuration for Adfinis SyGroup projects

Usage no npm install needed!

<script type="module">
  import adfinisSygroupSemanticReleaseConfig from 'https://cdn.skypack.dev/@adfinis-sygroup/semantic-release-config';
</script>

README

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 release branch instead of master
  • Add @semantic-release/git plugin to publish updated package.json to repository after deployment

Installation

Install the npm package

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

and add the following to the extends property 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 format by 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 commitizen for 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 cz instead of git commit.