File tree Expand file tree Collapse file tree 7 files changed +77
-61
lines changed Expand file tree Collapse file tree 7 files changed +77
-61
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Package
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - v*
7
+
8
+ jobs :
9
+ publish :
10
+ if : github.repository == 'qmhc/vite-plugin-dts'
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+ with :
15
+ fetch-depth : 0
16
+
17
+ - name : Install pnpm
18
+ uses : pnpm/action-setup@v2
19
+
20
+ - name : Set node
21
+ uses : actions/setup-node@v3
22
+ with :
23
+ node-version : 18.x
24
+ registry-url : https://registry.npmjs.org/
25
+ cache : pnpm
26
+
27
+ - name : Install deps
28
+ run : pnpm install
29
+
30
+ - name : Build
31
+ run : pnpm run build
32
+
33
+ - name : Publish package
34
+ run : pnpm run publish:ci ${{ github.ref_name }}
35
+ env :
36
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
37
+ NODE_OPTIONS : --max-old-space-size=4096
Original file line number Diff line number Diff line change 6
6
- v*
7
7
8
8
jobs :
9
- build :
10
- name : Create Release
9
+ release :
10
+ if : github.repository == 'qmhc/vite-plugin-dts'
11
11
runs-on : ubuntu-latest
12
12
steps :
13
- - name : Checkout code
14
- uses : actions/checkout@master
13
+ - uses : actions/checkout@v3
14
+ with :
15
+ fetch-depth : 0
16
+
17
+ - name : Set node
18
+ uses : actions/setup-node@v3
19
+ with :
20
+ node-version : 18.x
15
21
16
- - name : Create Release for Tag
17
- id : release_tag
18
- uses : yyx990803/release-tag@master
22
+ - run : npx changelogithub
19
23
env :
20
24
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
21
- with :
22
- tag_name : ${{ github.ref }}
23
- body : |
24
- Please refer to [CHANGELOG.md](https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md) for details.
Original file line number Diff line number Diff line change 15
15
"prepublishOnly" : " pinst --disable" ,
16
16
"prettier" : " pretty-quick --staged && pnpm run lint" ,
17
17
"postpublish" : " pinst --enable" ,
18
+ "publish:ci" : " tsx scripts/publish.ts" ,
18
19
"release" : " tsx scripts/release.ts" ,
19
20
"test" : " vitest run" ,
20
21
"test:dev" : " vitest" ,
Original file line number Diff line number Diff line change
1
+ import { resolve } from "node:path" ;
2
+ import { fileURLToPath } from "node:url" ;
3
+
4
+ export const rootDir = resolve ( fileURLToPath ( import . meta. url ) , '../..' )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import minimist from 'minimist'
2
+ import { logger , publish } from '@vexip-ui/scripts'
3
+ import { rootDir } from './constant'
4
+
5
+ const args = minimist < {
6
+ d ?: boolean ,
7
+ dry ?: boolean ,
8
+ t ?: string ,
9
+ tag ?: string
10
+ } > ( process . argv . slice ( 2 ) )
11
+
12
+ const isDryRun = args . dry || args . d
13
+ const releaseTag = args . tag || args . t
14
+
15
+ publish ( {
16
+ pkgDir : rootDir ,
17
+ isDryRun,
18
+ releaseTag
19
+ } ) . catch ( error => {
20
+ logger . error ( error )
21
+ process . exit ( 1 )
22
+ } )
Original file line number Diff line number Diff line change 1
- import path from 'node:path'
2
- import { fileURLToPath } from 'node:url'
3
1
import minimist from 'minimist'
4
- import { logger } from './logger '
5
- import { release , run } from '@vexip-ui/scripts '
2
+ import { logger , release , run } from '@vexip-ui/scripts '
3
+ import { rootDir } from './constant '
6
4
7
5
const args = minimist < {
8
6
d ?: boolean ,
@@ -16,8 +14,6 @@ const args = minimist<{
16
14
const isDryRun = args . dry || args . d
17
15
const preId = args . preid || args . p
18
16
19
- const rootDir = path . resolve ( fileURLToPath ( import . meta. url ) , '../..' )
20
-
21
17
release ( {
22
18
pkgDir : rootDir ,
23
19
isDryRun,
You can’t perform that action at this time.
0 commit comments