Skip to content

Commit 7db1bcf

Browse files
committed
chore: add script to create the git tag
1 parent 7845b05 commit 7db1bcf

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ bun run test
111111
1. Create a new git tag:
112112

113113
```bash
114-
yarn version:tag <package-name> <version>
115-
# e.g. yarn version:tag binary-merkle-root 0.0.1
114+
bun version:tag <package-name> <version>
115+
# e.g. bun version:tag binary-merkle-root 0.0.1
116116
```
117117

118118
2. Push the new git tag:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"postinstall": "husky && git config --local core.editor cat",
1313
"build": "nargo compile",
1414
"test": "bun run build && mocha && nargo test --workspace",
15-
"version:tag": "git tag ${0}-v${1}",
15+
"version:tag": "bun scripts/create-tag.ts",
1616
"version:release": "changelogithub"
1717
},
1818
"keywords": [

scripts/create-tag.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { execSync } from 'child_process'
2+
3+
const packageName = process.argv[2]
4+
const version = process.argv[3]
5+
6+
if (!packageName || !version) {
7+
console.error('❌ Please provide a package name and version')
8+
process.exit(1)
9+
}
10+
11+
try {
12+
execSync(`git tag ${packageName}-v${version}`, { stdio: 'inherit' })
13+
console.log(`✅ Created git tag: ${packageName}-v${version}`)
14+
} catch (err) {
15+
console.error('❌ Failed to create git tag', err)
16+
process.exit(1)
17+
}

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
},
1313
"include": [
1414
"./src/**/*.ts",
15-
"./tests/**/*.ts"
15+
"./tests/**/*.ts",
16+
"./scripts/**/*.ts"
1617
],
1718
"exclude": [
1819
"./dist"

0 commit comments

Comments
 (0)