Skip to content

Commit 467cff1

Browse files
committed
chore: add release script
1 parent e85f406 commit 467cff1

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Except
55
!.github
6+
!scripts
67
!src
78
!README.md
89
!.prettierrc

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"format": "prettier --write .",
2525
"format:check": "prettier --check .",
2626
"type:check": "tsc --noEmit",
27-
"type:check:package": "pnpm dlx @arethetypeswrong/cli --profile node16 --pack ."
27+
"type:check:package": "pnpm dlx @arethetypeswrong/cli --profile node16 --pack .",
28+
"release": "node ./scripts/release.ts"
2829
},
2930
"keywords": [
3031
"valorant",

scripts/release.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { execSync } from "child_process";
2+
import { parseArgs } from "util";
3+
4+
const { positionals } = parseArgs({
5+
args: process.argv.slice(2),
6+
allowPositionals: true,
7+
});
8+
9+
const version = positionals[0];
10+
11+
if (!version) {
12+
throw new Error("version is required");
13+
}
14+
15+
execSync(`pnpm version ${version} -m "chore: release %s"`, {
16+
stdio: "inherit",
17+
});
18+
execSync(`git push --follow-tags`, { stdio: "inherit" });

0 commit comments

Comments
 (0)