Skip to content

Commit 4207a85

Browse files
committed
chore: semantic release config
1 parent adc5bef commit 4207a85

File tree

5 files changed

+133
-2
lines changed

5 files changed

+133
-2
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- next
7+
- beta
8+
- alpha
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 'lts/*'
22+
- name: Install dependencies
23+
run: npm ci
24+
- name: Get version from package.json before release step
25+
id: get_version
26+
run: echo "::set-output name=version::$(npm run get-version --silent)"
27+
- name: Release
28+
id: release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
GIT_AUTHOR_NAME: bot-flowbuild
33+
GIT_AUTHOR_EMAIL: bot.flowbuild@gmail.com
34+
GIT_COMMITTER_NAME: bot-flowbuilld
35+
GIT_COMMITTER_EMAIL: bot.flowbuild@gmail.com
36+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
37+
run: npm run release

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ node_modules
44
.cache
55
dist
66
esbuild-why*.html
7+
.env
78
.npmrc

.releaserc.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"branches": [
3+
"master",
4+
{
5+
"name": "beta",
6+
"prerelease": true
7+
},
8+
{
9+
"name": "alpha",
10+
"prerelease": true
11+
},
12+
{
13+
"name": "next",
14+
"prerelease": true
15+
}
16+
],
17+
"plugins": [
18+
"@semantic-release/npm",
19+
[
20+
"@semantic-release/release-notes-generator",
21+
{
22+
"preset": "conventionalcommits"
23+
}
24+
],
25+
[
26+
"@semantic-release/commit-analyzer",
27+
{
28+
"preset": "conventionalcommits"
29+
}
30+
],
31+
[
32+
"@semantic-release/changelog",
33+
{
34+
"changelogFile": "CHANGELOG.md"
35+
}
36+
],
37+
[
38+
"@semantic-release/github",
39+
{
40+
"assets": ["CHANGELOG.md"]
41+
}
42+
],
43+
[
44+
"@semantic-release/git",
45+
{
46+
"assets": ["CHANGELOG.md"]
47+
}
48+
]
49+
]
50+
}

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
"fmt:check": "prettier --check src/**/*.{ts,tsx}",
4848
"prepare": "tsdx build && husky install",
4949
"size": "size-limit",
50-
"analyze": "size-limit --why"
50+
"analyze": "size-limit --why",
51+
"release": "semantic-release",
52+
"git-version": "echo $npm_package_version"
5153
},
5254
"peerDependencies": {
5355
"react": ">=18",
@@ -66,6 +68,8 @@
6668
],
6769
"devDependencies": {
6870
"@babel/core": "^7.21.0",
71+
"@semantic-release/changelog": "^6.0.2",
72+
"@semantic-release/git": "^10.0.1",
6973
"@size-limit/esbuild-why": "^8.2.4",
7074
"@size-limit/preset-small-lib": "^8.2.4",
7175
"@testing-library/jest-dom": "^5.16.5",
@@ -77,6 +81,7 @@
7781
"@typescript-eslint/eslint-plugin": "^5.54.0",
7882
"@typescript-eslint/parser": "^5.54.0",
7983
"babel-loader": "^9.1.2",
84+
"conventional-changelog-conventionalcommits": "^5.0.0",
8085
"eslint": "^8.35.0",
8186
"eslint-config-prettier": "^8.6.0",
8287
"eslint-import-resolver-typescript": "^3.5.3",

yarn.lock

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,16 @@
19591959
estree-walker "^1.0.1"
19601960
picomatch "^2.2.2"
19611961

1962+
"@semantic-release/changelog@^6.0.2":
1963+
version "6.0.2"
1964+
resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-6.0.2.tgz#fdcdbd368788c8fcc69c4af29bf2064f4afb45f4"
1965+
integrity sha512-jHqfTkoPbDEOAgAP18mGP53IxeMwxTISN+GwTRy9uLu58UjARoZU8ScCgWGeO2WPkEsm57H8AkyY02W2ntIlIw==
1966+
dependencies:
1967+
"@semantic-release/error" "^3.0.0"
1968+
aggregate-error "^3.0.0"
1969+
fs-extra "^11.0.0"
1970+
lodash "^4.17.4"
1971+
19621972
"@semantic-release/commit-analyzer@^9.0.2":
19631973
version "9.0.2"
19641974
resolved "https://registry.yarnpkg.com/@semantic-release/commit-analyzer/-/commit-analyzer-9.0.2.tgz#a78e54f9834193b55f1073fa6258eecc9a545e03"
@@ -1977,6 +1987,20 @@
19771987
resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-3.0.0.tgz#30a3b97bbb5844d695eb22f9d3aa40f6a92770c2"
19781988
integrity sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==
19791989

1990+
"@semantic-release/git@^10.0.1":
1991+
version "10.0.1"
1992+
resolved "https://registry.yarnpkg.com/@semantic-release/git/-/git-10.0.1.tgz#c646e55d67fae623875bf3a06a634dd434904498"
1993+
integrity sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==
1994+
dependencies:
1995+
"@semantic-release/error" "^3.0.0"
1996+
aggregate-error "^3.0.0"
1997+
debug "^4.0.0"
1998+
dir-glob "^3.0.0"
1999+
execa "^5.0.0"
2000+
lodash "^4.17.4"
2001+
micromatch "^4.0.0"
2002+
p-reduce "^2.0.0"
2003+
19802004
"@semantic-release/github@^8.0.0":
19812005
version "8.0.7"
19822006
resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-8.0.7.tgz#643aee7a5cdd2acd3ae643bb90ad4ac796901de6"
@@ -3755,6 +3779,15 @@ conventional-changelog-angular@^5.0.0:
37553779
compare-func "^2.0.0"
37563780
q "^1.5.1"
37573781

3782+
conventional-changelog-conventionalcommits@^5.0.0:
3783+
version "5.0.0"
3784+
resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz#41bdce54eb65a848a4a3ffdca93e92fa22b64a86"
3785+
integrity sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw==
3786+
dependencies:
3787+
compare-func "^2.0.0"
3788+
lodash "^4.17.15"
3789+
q "^1.5.1"
3790+
37583791
conventional-changelog-writer@^5.0.0:
37593792
version "5.0.1"
37603793
resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz#e0757072f045fe03d91da6343c843029e702f359"
@@ -7904,7 +7937,7 @@ merge2@^1.3.0, merge2@^1.4.1:
79047937
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
79057938
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
79067939

7907-
micromatch@4.x, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5:
7940+
micromatch@4.x, micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5:
79087941
version "4.0.5"
79097942
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
79107943
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
@@ -8850,6 +8883,11 @@ p-map@^4.0.0:
88508883
dependencies:
88518884
aggregate-error "^3.0.0"
88528885

8886+
p-reduce@^2.0.0:
8887+
version "2.1.0"
8888+
resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-2.1.0.tgz#09408da49507c6c274faa31f28df334bc712b64a"
8889+
integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==
8890+
88538891
p-reduce@^3.0.0:
88548892
version "3.0.0"
88558893
resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-3.0.0.tgz#f11773794792974bd1f7a14c72934248abff4160"

0 commit comments

Comments
 (0)