Skip to content

Commit 49c4465

Browse files
committed
Revision 0.9.1
1 parent 655878a commit 49c4465

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

deno.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"format": "deno run -A tasks.ts format",
55
"start": "deno run -A tasks.ts start",
66
"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"
89
},
910
"imports": {
1011
"@sinclair/parsebox": "./src/index.ts"

tasks.ts

+10
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,14 @@ Task.run('build', async () => {
4444
}
4545
},
4646
})
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}`)
4757
})

0 commit comments

Comments
 (0)