File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 4
4
"format" : " deno run -A tasks.ts format" ,
5
5
"start" : " deno run -A tasks.ts start" ,
6
6
"test" : " deno run -A tasks.ts test" ,
7
- "build" : " deno run -A tasks.ts build"
7
+ "build" : " deno run -A tasks.ts build" ,
8
+ "publish" : " deno run -A tasks.ts publish"
8
9
},
9
10
"imports" : {
10
11
"@sinclair/parsebox" : " ./src/index.ts"
Original file line number Diff line number Diff line change @@ -44,4 +44,14 @@ Task.run('build', async () => {
44
44
}
45
45
} ,
46
46
} )
47
+ } )
48
+ // ------------------------------------------------------------------
49
+ // Build
50
+ // ------------------------------------------------------------------
51
+ Task . run ( 'publish' , async ( otp : string , target : string = `target/build` ) => {
52
+ const { version } = JSON . parse ( await Deno . readTextFile ( `${ target } /package.json` ) )
53
+ if ( version . includes ( '-dev' ) ) throw Error ( `package version should not include -dev specifier` )
54
+ await Task . shell ( `cd ${ target } && npm publish sinclair-parsebox-${ version } .tgz --access=public --otp ${ otp } ` )
55
+ await Task . shell ( `git tag ${ version } ` )
56
+ await Task . shell ( `git push origin ${ version } ` )
47
57
} )
You can’t perform that action at this time.
0 commit comments