Skip to content

Commit 0ab75cf

Browse files
committed
feat: add dependency management automation (I-1676).
1 parent 8727d20 commit 0ab75cf

File tree

4 files changed

+12758
-6275
lines changed

4 files changed

+12758
-6275
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v1
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: 12
17+
- name: Cache
18+
uses: actions/cache@v1
19+
with:
20+
path: ~/.npm
21+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-npm-
24+
- name: Install dependencies
25+
run: npm ci
26+
- name: Release
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
29+
run: npx semantic-release

.releaserc.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
'use strict';
2+
3+
/* The releaseConfig object drives configuration across 5 semantic-release plugins. For more details on the
4+
plugin options and overides used see:
5+
- @semantic-release/commit-analyzer: https://github.com/semantic-release/commit-analyzer
6+
- @semantic-release/release-notes-generator: https://github.com/semantic-release/release-notes-generator
7+
- @semantic-release/changelog: https://github.com/semantic-release/changelog
8+
- @semantic-release/npm: https://github.com/semantic-release/npm#semantic-releasenpm
9+
- @semantic-release/git: https://github.com/semantic-release/git
10+
- @semantic-release/github: https://github.com/semantic-release/github
11+
*/
12+
13+
function compileReleaseRules(listOfTypes, release = 'patch') {
14+
return listOfTypes.map(type => ({
15+
type,
16+
release
17+
}));
18+
}
19+
20+
const typesForPatch = ['docs', 'style', 'refactor', 'perf'];
21+
const typesForMinor = ['feat'];
22+
const parserOpts = {
23+
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING']
24+
};
25+
26+
const releaseConfig = {
27+
branches: ['master'],
28+
plugins: [
29+
[
30+
'@semantic-release/commit-analyzer',
31+
{
32+
releaseRules: [
33+
...compileReleaseRules(typesForPatch),
34+
...compileReleaseRules(typesForMinor, 'minor')
35+
],
36+
parserOpts
37+
}
38+
],
39+
[
40+
'@semantic-release/release-notes-generator',
41+
{
42+
parserOpts
43+
}
44+
],
45+
'@semantic-release/changelog',
46+
[
47+
'@semantic-release/npm',
48+
{
49+
npmPublish: false
50+
}
51+
],
52+
[
53+
'@semantic-release/git',
54+
{
55+
assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
56+
message:
57+
'chore(release): ${nextRelease.version} \n\n${nextRelease.notes}'
58+
}
59+
],
60+
'@semantic-release/github'
61+
]
62+
};
63+
64+
module.exports = releaseConfig;

0 commit comments

Comments
 (0)