Skip to content

Commit 24c572f

Browse files
authored
chore: add semantic-release setup
1 parent ea73606 commit 24c572f

File tree

3 files changed

+2668
-36
lines changed

3 files changed

+2668
-36
lines changed

.github/workflows/npm-release.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
name: CI
3+
on: push
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-node@v1
10+
with:
11+
node-version: '14'
12+
- run: npm ci
13+
- run: npm run build
14+
- run: npm test
15+
- name: Release
16+
env:
17+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
run: npx semantic-release

package.json

+18-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
},
1111
"scripts": {
1212
"build": "tsc -b",
13-
"test": "jest"
13+
"test": "jest",
14+
"semantic-release": "semantic-release"
1415
},
1516
"repository": "https://github.com/nteract/mathjax",
1617
"keywords": [
@@ -26,16 +27,30 @@
2627
"react-dom": "^16.13.0 || ^17.0.0"
2728
},
2829
"devDependencies": {
29-
"react": "^16.13.0",
30-
"react-dom": "^16.13.0",
30+
"@semantic-release/npm": "^7.1.3",
3131
"@types/enzyme": "^3.10.5",
3232
"@types/jest": "^25.1.4",
3333
"@types/react": "^16.9.23",
34+
"conventional-changelog-conventionalcommits": "^4.6.0",
3435
"enzyme": "^3.11.0",
3536
"enzyme-adapter-react-16": "^1.15.2",
3637
"enzyme-to-json": "^3.4.4",
3738
"jest": "^25.1.0",
39+
"react": "^16.13.0",
40+
"react-dom": "^16.13.0",
41+
"semantic-release": "^17.4.4",
3842
"ts-jest": "^25.2.1",
3943
"typescript": "^3.8.3"
44+
},
45+
"release": {
46+
"plugins": [
47+
"@semantic-release/npm",
48+
[
49+
"@semantic-release/commit-analyzer",
50+
{
51+
"preset": "conventionalcommits"
52+
}
53+
]
54+
]
4055
}
4156
}

0 commit comments

Comments
 (0)