Skip to content

Commit d70edcf

Browse files
authored
ci: add release script (#774)
* feat: add release script and github publish action * feat: add step for install legacy dependencies
1 parent 4820adc commit d70edcf

File tree

3 files changed

+279
-2
lines changed

3 files changed

+279
-2
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
name: Publish package
9+
steps:
10+
- name: Checkout the repository
11+
uses: actions/checkout@v2
12+
- name: Install pnpm
13+
uses: pnpm/[email protected]
14+
with:
15+
version: 6
16+
- name: Install Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 16
20+
cache: 'pnpm'
21+
registry-url: 'https://registry.npmjs.org'
22+
- name: Install dependencies
23+
run: pnpm install
24+
- name: Install dependencies to legacy folder
25+
working-directory: legacy
26+
run: pnpm install
27+
- name: Publish
28+
run: pnpm publish --no-git-checks
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@
6161
"test:typings": "tsd",
6262
"lint": "eslint 'src/**/*.ts'",
6363
"format": "prettier --write src test",
64-
"release": "standard-version",
6564
"docs:dev": "vuepress dev docs",
6665
"docs:build": "vuepress build docs",
6766
"commit": "cz",
6867
"start:storybook": "start-storybook -p 6006",
69-
"build:storybook": "del ./storybook-static; NODE_ENV=production build-storybook"
68+
"build:storybook": "del ./storybook-static; NODE_ENV=production build-storybook",
69+
"bumpVersion": "standard-version",
70+
"createGithubRelease": "simple-github-release",
71+
"release": "pnpm bumpVersion && git push origin main --tags && pnpm createGithubRelease"
7072
},
7173
"peerDependencies": {
7274
"chart.js": "^3.7.0",
@@ -116,6 +118,7 @@
116118
"rollup": "^2.66.1",
117119
"rollup-plugin-swc": "^0.2.0",
118120
"simple-git-hooks": "^2.7.0",
121+
"simple-github-release": "^1.0.0",
119122
"size-limit": "^7.0.8",
120123
"standard-version": "^9.3.2",
121124
"tsd": "^0.19.1",

0 commit comments

Comments
 (0)