diff --git a/Cargo.lock b/Cargo.lock index 5f1c44b..7f645aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,7 +51,7 @@ checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "catj" -version = "0.2.0" +version = "0.2.1" dependencies = [ "cgroups-rs", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 92525b7..935dd06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "catj" -version = "0.2.0" +version = "0.2.1" authors = ["XLor yjl9903@outlook.com"] edition = "2021" diff --git a/README.md b/README.md index d8e1ccd..9f653b9 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/release.ts b/release.ts new file mode 100755 index 0000000..47e4edb --- /dev/null +++ b/release.ts @@ -0,0 +1,18 @@ +#!/usr/bin/env optc + +/// + +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`; +}