Skip to content

Commit 7698e0a

Browse files
authored
ci: add semantic relase to automate release process (#17)
1 parent 71b125a commit 7698e0a

File tree

4 files changed

+2496
-63
lines changed

4 files changed

+2496
-63
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
persist-credentials: true
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "20"
23+
24+
- name: Install dependencies
25+
run: yarn install
26+
27+
- name: Build project
28+
run: yarn build
29+
30+
- name: Create release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
npx semantic-release

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
},
3939
"devDependencies": {
4040
"@chromatic-com/storybook": "^1.5.0",
41+
"@semantic-release/git": "^10.0.1",
42+
"@semantic-release/github": "^10.1.4",
4143
"@storybook/addon-essentials": "^8.1.10",
4244
"@storybook/addon-interactions": "^8.1.10",
4345
"@storybook/addon-links": "^8.1.10",
@@ -58,6 +60,7 @@
5860
"postcss": "^8.4.38",
5961
"react": "^17.0.0 || ^18.0.0",
6062
"react-dom": "^17.0.0 || ^18.0.0",
63+
"semantic-release": "^24.0.0",
6164
"storybook": "^8.1.10",
6265
"tailwindcss": "^3.4.4",
6366
"tsup": "^8.1.0",

release.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
branches: ["main"],
3+
plugins: [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/github",
7+
[
8+
"@semantic-release/git",
9+
{
10+
assets: ["dist/*"],
11+
message:
12+
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
13+
},
14+
],
15+
],
16+
};

0 commit comments

Comments
 (0)