Skip to content

Commit fe113a5

Browse files
authored
Build: Use semantic-release with ESLint preset (#1459)
* All types of releases are automated * Slightly different commit message convention
1 parent adc7fe1 commit fe113a5

File tree

3 files changed

+69
-32
lines changed

3 files changed

+69
-32
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ jobs:
6868

6969
- stage: release
7070
script:
71-
- npm install --no-save semantic-release-tamia
72-
- >-
73-
npx semantic-release --analyze-commits semantic-release-tamia/analyzeCommits --verify-release semantic-release-tamia/verifyRelease --generate-notes semantic-release-tamia/generateNotes
71+
- npx semantic-release
7472

7573
- stage: documentation
7674
script:

docs/Maintenance.md

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
- [Pull requests](#pull-requests)
1010
- [Releases](#releases)
1111
- [Patch releases](#patch-releases)
12-
- [Minor and major releases](#minor-and-major-releases)
12+
- [Minor releases](#minor-releases)
13+
- [Major releases](#major-releases)
1314
- [Changelogs](#changelogs)
1415
- [What is a good changelog](#what-is-a-good-changelog)
1516
- [What should be in a changelog](#what-should-be-in-a-changelog)
16-
- [Preparing a changelog](#preparing-a-changelog)
1717

1818
<!-- tocstop -->
1919

@@ -30,34 +30,68 @@ Help us develop and maintain Styleguidist:
3030

3131
## Commit message conventions
3232

33-
[Commit message conventions](https://github.com/tamiadev/semantic-release-tamia/blob/master/Convention.md) are based on Angular conventions.
33+
We use [ESLint commit message conventions](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint).
34+
35+
Each commit looks like this:
36+
37+
```
38+
Tag: Short description (fixes #1234)
39+
40+
Longer description here if necessary
41+
```
42+
43+
The `Tag` is one of the following:
44+
45+
- `Fix` — for a bug fix.
46+
- `Update` — for a backwards-compatible enhancement.
47+
- `New` — implemented a new feature.
48+
- `Breaking` — for a backwards—incompatible enhancement or feature.
49+
- `Docs` — changes to documentation only.
50+
- `Build` — changes to build process only.
51+
- `Upgrade` — for a dependency upgrade.
52+
- `Chore` — for refactoring, adding tests and so on (anything that isn’t user-facing).
53+
54+
If the commit doesn’t completely fix the issue, then use (`refs #1234`) instead of (`fixes #1234`).
55+
56+
Here are some good commit message summary examples:
57+
58+
```
59+
Build: Update Travis to only test Node 0.10 (refs #734)
60+
Fix: Semi rule incorrectly flagging extra semicolon (fixes #840)
61+
Upgrade: Esprima to 1.2, switch to using comment attachment (fixes #730)
62+
```
3463

3564
## Pull requests
3665

37-
Maintainers merge pull requests by squashing all commits and editing the commit message if necessary.
66+
Maintainers merge pull requests by squashing all commits and editing the commit message if necessary using the GitHub user interface.
3867

39-
Use an [appropriate commit type](https://github.com/tamiadev/semantic-release-tamia/blob/master/Convention.md#types). Be especially careful with [breaking changes](https://github.com/tamiadev/semantic-release-tamia/blob/master/Convention.md#breaking-changes).
68+
Use an appropriate commit type. Be especially careful with breaking changes. See _Commit message conventions_ above for details.
4069

4170
## Releases
4271

43-
We’re doing [semi-automated releases](http://blog.sapegin.me/all/semantic-release) with semantic-release.
72+
We’re doing automated releases with semantic-release. We’re using [milestones](https://github.com/styleguidist/react-styleguidist/milestones) to group approved pull requests that should be released together (most useful for major releases).
4473

4574
### Patch releases
4675

47-
Patch releases are fully automated — any commit of a `Fix` type is published as a patch release as soon as CI passes.
76+
Any commit of a `Fix` or `Update` types merged into the master branch, is published as a _patch_ release as soon as CI passes.
4877

4978
![](https://d3vv6lp55qjaqc.cloudfront.net/items/1T3v1z0c3f1I1E3l0B3s/patch-commit.png)
5079

51-
### Minor and major releases
80+
### Minor releases
5281

53-
We’re using [milestones](https://github.com/styleguidist/react-styleguidist/milestones) to group approved pull requests that should be released together. Minor and major releases require a changelog (see below). Any commit of a `Feat` type will not trigger a release until you commit a changelog. Semantic-release will publish a major release if there are any commits with [breaking changes](https://github.com/tamiadev/semantic-release-tamia/blob/master/Convention.md#breaking-changes).
82+
Any commit of a `New` type merged into the master branch, is published as a _minor_ release as soon as CI passes.
5483

55-
1. Merge all pull request from a milestone
56-
2. Resolve possible merge conflicts.
57-
3. Manually check that Styleguidist still works.
58-
4. Prepare and commit a changelog.
59-
5. Wait until semantic-release publishes the release.
60-
6. Tweet the release!
84+
### Major releases
85+
86+
Any commit of a `Breaking` type merged into the master branch, is published as a _major_ release as soon as CI passes.
87+
88+
1. Merge all pull requests from a milestone. If a milestone has more than one pull request, they should be merged and released together:
89+
1. Create a new branch.
90+
2. Merge all pull requests into this new branch (you can change the target branch on the pull request page and merge it using the GitHub user interface).
91+
3. Resolve possible merge conflicts.
92+
2. Wait until semantic-release publishes the release.
93+
3. Edit the release notes on GitHub (see _Changelogs_ below).
94+
4. Tweet the release!
6195

6296
## Changelogs
6397

@@ -67,24 +101,11 @@ We’re using [milestones](https://github.com/styleguidist/react-styleguidist/mi
67101
- Changelog should show new features with code examples or GIFs.
68102
- Changelog should make all breaking changes clear.
69103
- Changelog should explain how to migrate to a new version if there are breaking changes.
70-
- Commit log **is not** a changelog.
104+
- Commit log **is not** a changelog but can be a base for it.
71105

72106
Here’s a [good example of a changelog](https://github.com/styleguidist/react-styleguidist/releases/tag/v7.1.0). Check out [Keep a Changelog](https://keepachangelog.com/) for more details on good changelogs.
73107

74108
### What should be in a changelog
75109

76110
- Information about pull request authors:<br> `(#1040 by @rafaesc)`
77111
- Open Collective link at the very top:<br> `👋 **[Support Styleguidist](https://opencollective.com/styleguidist) on Open Collective** 👋`
78-
79-
### Preparing a changelog
80-
81-
1. Change to the `master` branch.
82-
2. Generate a changelog draft using [tamia-changelog](https://github.com/tamiadev/tamia-changelog): `npx tamia-changelog`.
83-
3. Edit `Changelog.md` file.
84-
4. Commit the changelog: `npx tamia-changelog commit`.
85-
86-
**Note:** do not commit the `Changelog.md` file, the release tool reads the changelog from the commit message. [Read how it works](https://blog.sapegin.me/all/semantic-release/).
87-
88-
**Note:** you may create a pull request for a changelog. Make sure the actual commit in the `master` branch has a `Changelog:` tag for the release tool to see it.
89-
90-
![Commit message with a changelog](https://user-images.githubusercontent.com/70067/66844661-f6f1e600-ef6e-11e9-9d63-dba607d3c94b.png)

release.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
plugins: [
3+
[
4+
'@semantic-release/commit-analyzer',
5+
{
6+
preset: 'eslint',
7+
},
8+
],
9+
[
10+
'@semantic-release/release-notes-generator',
11+
{
12+
preset: 'eslint',
13+
},
14+
],
15+
'@semantic-release/npm',
16+
'@semantic-release/github',
17+
],
18+
};

0 commit comments

Comments
 (0)