Skip to content

Commit a898bf0

Browse files
author
Giuseppe Verni
committed
chore: update release automation scripts
* Add a `.releaserc.json` config file * Fix typos in `release` * Add webpack release to `release` * Add autocommit of assets during release * Add lint
1 parent 21c938c commit a898bf0

File tree

3 files changed

+42
-17
lines changed

3 files changed

+42
-17
lines changed

.github/workflows/release.js.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,37 @@ on:
66
branches:
77
- main
88

9-
jobs:
10-
build:
9+
jobs:
10+
release:
1111
if: "!contains(github.event.commits[0].message, '[skip ci]')"
1212
runs-on: ubuntu-latest
13-
timeout-minutes: 10
1413

1514
steps:
1615
- uses: actions/checkout@v2
17-
- name: Install npm dependencies
1816
- uses: actions/setup-node@v2
1917
with:
20-
node-version: '12'
21-
- run: npm install
18+
node-version: '12'
19+
20+
- name: Install npm dependencies
21+
run: npm install
22+
23+
- name: Lint
24+
run: npm run lint
25+
2226
- name: Test
23-
- run: npm test
24-
- name: Build
25-
- run: npm run build
26-
27-
release:
28-
if: "!contains(github.event.commits[0].message, '[skip ci]')"
29-
needs: build
30-
runs-on: ubuntu-latest
27+
run: npm test
3128

32-
steps:
29+
- name: Build
30+
run: npm run release
31+
3332
- name: Run automated release process with semantic-release
3433
if: github.event_name == 'push'
3534
uses: cycjimmy/semantic-release-action@v2
3635
with:
3736
extra_plugins: |
3837
@semantic-release/changelog
38+
@semantic-release/git
39+
branch: main
3940
env:
4041
GH_TOKEN: ${{ secrets.GH_TOKEN }}
4142
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.js.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19+
1920
- name: Use Node.js ${{ matrix.node-version }}
2021
uses: actions/setup-node@v2
2122
with:
2223
node-version: ${{ matrix.node-version }}
2324
cache: 'npm'
24-
- run: npm install
25-
- run: npm test
25+
26+
- name: Install npm dependencies
27+
run: npm install
28+
29+
- name: Lint
30+
run: npm run lint
31+
32+
- name: Test
33+
run: npm test

.releaserc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"branch": "main",
3+
"plugins": [
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/changelog",
6+
"@semantic-release/npm",
7+
"@semantic-release/github",
8+
[
9+
"@semantic-release/git",
10+
{
11+
"assets": ["docs/scripts/segmentsCalculator.js", "dist/**", "package.json", "CHANGELOG.md"],
12+
"message": "chore(release): Release ${nextRelease.version} [skip ci]"
13+
}
14+
]
15+
]
16+
}

0 commit comments

Comments
 (0)