Skip to content

Commit 6b68541

Browse files
committed
feat: Add semantic release
1 parent b126403 commit 6b68541

File tree

4 files changed

+2468
-52
lines changed

4 files changed

+2468
-52
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Publish on NPM
22

33
on:
4-
release:
5-
types: [created]
4+
push:
5+
branches: [main, beta]
66

77
jobs:
88
build:
@@ -14,6 +14,7 @@ jobs:
1414
node-version: 12
1515
registry-url: 'https://registry.npmjs.org'
1616
- run: yarn install --frozen-lockfile
17-
- run: yarn publish
17+
- run: yarn run build
18+
- run: npx semantic-release
1819
env:
19-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.releaserc

Whitespace-only changes.

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-click-away-listener",
3-
"version": "1.5.3",
3+
"version": "1.0.0-semantic-release",
44
"description": "A simple click away listener built with React Hooks",
55
"main": "dist/react-click-away-listener.js",
66
"module": "dist/react-click-away-listener.es.js",
@@ -32,6 +32,7 @@
3232
"@babel/preset-react": "^7.0.0",
3333
"@babel/preset-typescript": "^7.10.4",
3434
"@rollup/plugin-babel": "^5.2.0",
35+
"@semantic-release/npm": "^7.0.10",
3536
"@testing-library/react": "^9.3.1",
3637
"@types/jest": "^24.0.21",
3738
"@types/react": "^16.9.11",
@@ -68,5 +69,18 @@
6869
"ghooks": {
6970
"pre-commit": "npm run prettier"
7071
}
72+
},
73+
"release": {
74+
"branches": [
75+
"main",
76+
{
77+
"name": "beta",
78+
"prerelease": true
79+
}
80+
],
81+
"plugins": [
82+
"@semantic-release/commit-analyzer",
83+
"@semantic-release/npm"
84+
]
7185
}
7286
}

0 commit comments

Comments
 (0)