Skip to content

Commit a355250

Browse files
committed
chore: setup semantic release, update github actions workflow, update husky
1 parent 6245316 commit a355250

10 files changed

+3535
-128
lines changed

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"ecmaVersion": "latest",
99
"sourceType": "module"
1010
},
11+
"ignorePatterns": ["commitlint.config.cjs"],
1112
"plugins": ["@typescript-eslint", "import", "no-relative-import-paths"],
1213
"extends": [
1314
"plugin:import/recommended",

.github/workflows/publish.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
with:
17+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
18+
19+
- name: Install Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: "yarn"
24+
25+
- name: Install dependencies
26+
run: yarn install
27+
28+
- name: Semantic Release
29+
uses: cycjimmy/semantic-release-action@v4
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

-35
This file was deleted.

.husky/commit-msg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
npx commitlint --edit "$1"

.husky/pre-commit

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
1+
#!/bin/sh
42
yarn format:changed

.husky/pre-push

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
1+
#!/bin/sh
42
yarn format:changed
5-
yarn lint
3+
yarn lint --strict
4+
yarn test
65
yarn build
76
yarn cypress

.releaserc.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
"@semantic-release/github",
8+
[
9+
"@semantic-release/git",
10+
{
11+
"assets": ["package.json", "CHANGELOG.md"],
12+
"message": "chore(release): ${nextRelease.version} [skip ci]"
13+
}
14+
]
15+
]
16+
}

commitlint.config.cjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ["@commitlint/config-conventional"],
3+
};

package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"storybook": "storybook dev -p 6006",
1414
"build-storybook": "storybook build",
1515
"format:changed": "git diff --name-only --diff-filter=d HEAD | grep -e 'src.*\\.[jt]sx\\?$' -e 'src.*\\.json$' -e 'src.*\\.css$' -e 'src.*\\.md$' | xargs prettier -u --write",
16-
"postinstall": "husky install"
16+
"prepare": "husky install"
1717
},
1818
"dependencies": {
1919
"@hello-pangea/dnd": "^16.3.0",
@@ -37,7 +37,12 @@
3737
"zod": "^3.22.2"
3838
},
3939
"devDependencies": {
40+
"@commitlint/cli": "^19.6.1",
41+
"@commitlint/config-conventional": "^19.6.0",
4042
"@next/eslint-plugin-next": "^13.4.12",
43+
"@semantic-release/changelog": "^6.0.3",
44+
"@semantic-release/git": "^10.0.1",
45+
"@semantic-release/github": "^11.0.1",
4146
"@storybook/addon-essentials": "^7.6.4",
4247
"@storybook/addon-interactions": "^7.6.4",
4348
"@storybook/addon-links": "^7.6.4",
@@ -65,12 +70,13 @@
6570
"eslint-plugin-no-relative-import-paths": "^1.5.2",
6671
"eslint-plugin-storybook": "^0.6.15",
6772
"eslint-plugin-tailwindcss": "^3.17.0",
68-
"husky": "^8.0.0",
73+
"husky": "^9.1.7",
6974
"jest": "^29.6.2",
7075
"jest-environment-jsdom": "^29.6.2",
7176
"postcss": "8.4.27",
7277
"prettier": "^3.0.1",
7378
"prettier-plugin-tailwindcss": "^0.6.1",
79+
"semantic-release": "^24.2.1",
7480
"storybook": "^7.6.4",
7581
"tailwindcss": "3.3.3",
7682
"tsconfig-paths-webpack-plugin": "^4.1.0",

0 commit comments

Comments
 (0)