Skip to content

Commit

Permalink
feat: add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Oct 6, 2023
1 parent 535e65e commit 6d86670
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "catj"
version = "0.2.0"
version = "0.2.1"
authors = ["XLor yjl9903@outlook.com"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $ curl -fsSL https://bina.egoist.sh/CaCatHead/CatBox | sh

# Check installation
$ catj --version
catj 0.1.5
catj 0.2.1

# Init cgroup for current user
$ ./init.sh $USER
Expand Down
18 changes: 18 additions & 0 deletions release.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env optc

/// <reference path="/root/.optc/globals.d.ts" />

export default async function(version: string) {
if (!/^\d+\.\d+\.\d+$/.test(version)) {
return;
}

const toml = readTextFile('Cargo.toml');
writeTextFile('Cargo.toml', toml.replace(/version = "\d+\.\d+\.\d+"/, `version = "${version}"`));
writeTextFile('README.md', readTextFile('README.md').replace(/catj \d+\.\d+\.\d+/, `catj ${version}`));

await $`git add Cargo.toml README.md`;
await $`git commit -m "chore: release v${version}"`;
await $`git tag -a v${version} -m "chore: release v${version}"`;
await $`git push --tags origin main`;
}

0 comments on commit 6d86670

Please sign in to comment.