Skip to content

Commit f2c2779

Browse files
authored
chore: automate release (#48)
* chore: add semantic-release and its plugins * ci: add release action workflow
1 parent 8e483c1 commit f2c2779

4 files changed

Lines changed: 2057 additions & 37 deletions

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 'lts/*'
21+
- name: Install dependencies
22+
run: yarn install --frozen-lockfile
23+
- name: Release
24+
env:
25+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: yarn semantic-release --branches master main

.releaserc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
[
6+
"@semantic-release/changelog",
7+
{
8+
"changelogFile": "./CHANGELOG.md"
9+
}
10+
],
11+
[
12+
"@semantic-release/git",
13+
{
14+
"assets": ["./CHANGELOG.md"]
15+
}
16+
],
17+
"@semantic-release/github",
18+
"@semantic-release/npm"
19+
]
20+
}

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mml-react",
3-
"version": "0.4.3",
3+
"version": "0.0.0-development",
44
"description": "MML (Message Markup Language) for React.",
55
"author": "Getstream.io",
66
"homepage": "https://getstream.github.io/mml-react/",
@@ -37,7 +37,8 @@
3737
"prepare": "yarn build",
3838
"preversion": "yarn install && yarn lint && yarn test",
3939
"version": "yarn docs-build && git add -A docs",
40-
"postversion": "git push && git push --tags && npm publish"
40+
"postversion": "git push && git push --tags && npm publish",
41+
"semantic-release": "semantic-release"
4142
},
4243
"engines": {
4344
"node": ">=10"
@@ -57,6 +58,8 @@
5758
"react-virtuoso": "^2.2.1"
5859
},
5960
"devDependencies": {
61+
"@semantic-release/changelog": "^6.0.1",
62+
"@semantic-release/git": "^10.0.1",
6063
"@size-limit/preset-big-lib": "^4.9.2",
6164
"@types/react": "^17.0.2",
6265
"@types/react-dom": "^17.0.1",
@@ -70,6 +73,7 @@
7073
"react-test-renderer": "^17.0.1",
7174
"rollup-plugin-ignore-import": "^1.3.2",
7275
"rollup-plugin-scss": "^2.6.1",
76+
"semantic-release": "^19.0.2",
7377
"size-limit": "^4.9.2",
7478
"styled-components": "^5.2.1",
7579
"tsdx": "^0.14.1",

0 commit comments

Comments
 (0)