Skip to content

Commit

Permalink
Add just task to bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
olanod committed Jan 31, 2024
1 parent 87c1b73 commit 5a2b0f5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@ release-artifacts: _copy_compressed_runtime create-container
release-tag:
git tag {{ ver }}

bump mode="minor":
#!/usr/bin/env nu
let ver = '{{ ver }}' | inc --{{ mode }}
open -r runtime/kreivo/Cargo.toml | str replace -m '^version = "(.+)"$' $'version = "($ver)"' | save -f runtime/kreivo/Cargo.toml
open -r node/Cargo.toml | str replace -m '^version = "(.+)"$' $'version = "($ver)"' | save -f node/Cargo.toml
# bump spec version
const SRC = 'runtime/kreivo/src/lib.rs'
let src = open $SRC
let spec_ver = ($src | grep spec_version | parse -r '\s*spec_version: (?<ver>\w+),' | first | get ver | into int)
$src | str replace -m '(\s*spec_version:) (\w+)' $'$1 ($spec_ver | $in + 1)' | save -f $SRC
# assume minor and major versions channge tx version
let bump_tx = '{{ mode }}' == 'minor' or '{{ mode }}' == 'major'
echo $bump_tx
if $bump_tx {
let src = open $SRC
let tx_ver = ($src | grep transaction_version | parse -r '\s*transaction_version: (?<ver>\w+),' | first | get ver | into int)
$src | str replace -m '(\s*transaction_version:) (\w+)' $'$1 ($tx_ver | $in + 1)' | save -f $SRC
}

_zufix := os() + if os() == "linux" { "-x64" } else { "" }
zombienet network="": build-local
#!/usr/bin/env nu
Expand Down

0 comments on commit 5a2b0f5

Please sign in to comment.