Skip to content

Latest commit

 

History

History
235 lines (173 loc) · 4.9 KB

semantic-awesomeness.md

File metadata and controls

235 lines (173 loc) · 4.9 KB

title: Semantic Awesomeness style: ./semantic-awesomeness.css controls: false

-- bg bg-intro

Semantic Awesomeness


Merge to master and have a release
by [Vladimir Starkov](https://iamstarkov.com)
frontend engineer at [Nordnet Bank AB](https://www.nordnet.se/)

-- bg bg-headaches

Headaches

-- bg bg-mynameis

My name is Vladimir Starkov

-- bg bg-problem

Problem

-- bg bg-semver

Semantic Versioning

--

1.0.0

or

  • MAJOR: intended
  • MINOR: that was unexpected
  • FIX: wow, who could thought of it

-- bg bg-history

History

--

History

-- bg bg-semantic-release

Semantic release

--

Semantic release

--

Semantic release

conventional format

type(scope?): short message

long description

BREAKING CHANGES or github/jira issues mentions

-- bg bg-practicalities

Practicalities

--

Practicalities

Prerequisites

  1. Continuous Integration in place
  2. release-bot credentials:
  • SCM access
  • NPM registry

--

Practicalities

Tool choice

--

Practicalities

Writing commit messages

commitizen + cz-conventional-changelog config

// ./package.json
"scripts": {
  "commit": "git-cz",
  // ...
},
"config": {
  "commitizen": {
    "path": "cz-conventional-changelog"
  }
},

--

Practicalities

Writing commit messages

--

Practicalities

Validating commit messages

husky + @commitlint/{cli,config-angular}

// ./package.json
"scripts": {
  "commitmsg": "commitlint -e $GIT_PARAMS",
}

// commitlint.config.js
module.exports = { extends: [ '@commitlint/config-angular'] }

-- images

Practicalities

Validating commit messages

Invalid:

Valid:

--

Practicalities

CI Integration

  • run semantic-release only in master
  • ignore commit message [ci-skip]
  • ignore git tags
  • ignore the release-bot

--

Practicalities

semantic-release

npm install --save-dev semantic-release

// ./.travis.yml
git config user.email "release-bot@localhost"
git config user.name "release-bot"
npm run build
npm run semantic-release

// ./package.json
"scripts": {
  "semantic-release": "semantic-release pre && npm publish && semantic-release post",
}

-- images

Practicalities

semantic-release changelog

--

Practicalities

corp-semantic-release

npm install --save-dev corp-semantic-release conventional-changelog-angular-bitbucket

// ./.travis.yml
git config user.email "release-bot@localhost"
git config user.name "release-bot"
git checkout master
npm run build
npm run semantic-release
npm publish

// ./package.json
"scripts": {
  "semantic-release": "corp-semantic-release --changelogpreset angular-bitbucket -v",
}

-- images

Practicalities

semantic-release changelog

-- bg bg-summary

Summary

-- bg bg-outro

Semantic Awesomeness


In painless releases we trust
Sincerely yours [Vladimir Starkov](https://iamstarkov.com) _@iamstarkov on [github](https://github.com/iamstarkov) and [twitter](https://twitter.com/iamstarkov)_