Skip to content

Commit c2b0833

Browse files
committed
chore: update release script
1 parent c4a02eb commit c2b0833

1 file changed

Lines changed: 8 additions & 30 deletions

File tree

release

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33
set -o pipefail
44

55
readonly VERSION="${1:-$(date +%Y.%-m.%-d)}"
6-
readonly IS_JUJUTSU="$(if jj root &> /dev/null; then echo 1; else echo 0; fi)"
76

8-
cd "$(git rev-parse --show-toplevel)"
7+
cd "$(jj root)"
98

10-
if [ "${IS_JUJUTSU}" -eq 1 ]
9+
if jj show --stat | tail -n -1 | grep -q '^0 files changed'
1110
then
12-
if jj show --stat | tail -n -1 | grep -q '^0 files changed'
13-
then
14-
jj describe -m "chore: version ${VERSION}"
15-
else
16-
jj new -m "chore: version ${VERSION}"
17-
fi
11+
jj describe -m "chore: version ${VERSION}"
12+
else
13+
jj new -m "chore: version ${VERSION}"
1814
fi
1915

2016
cargo set-version "${VERSION}"
@@ -23,32 +19,14 @@ cargo upgrade
2319
cargo update
2420

2521
cargo check
26-
cargo test --bins
27-
28-
RUST_LOG=warn cargo run -- list-systemd-options | head -n -1 > systemd_options.md
29-
30-
if [ "${IS_JUJUTSU}" -eq 0 ]
31-
then
32-
git add Cargo.{toml,lock} systemd_options.md
22+
cargo test
3323

34-
git commit -m "chore: version ${VERSION}"
35-
fi
36-
37-
if [ "${IS_JUJUTSU}" -eq 1 ]
38-
then
39-
jj new
40-
fi
24+
jj new
4125

4226
git tag -f -m "Version ${VERSION}" "v${VERSION}"
4327
git cliff | head -n -3 > CHANGELOG.md
4428
git tag -d "v${VERSION}"
4529

46-
if [ "${IS_JUJUTSU}" -eq 1 ]
47-
then
48-
jj squash -u
49-
else
50-
git add CHANGELOG.md
51-
git commit --amend --no-edit
52-
fi
30+
jj squash -u
5331

5432
git tag -f -m "Version ${VERSION}" "v${VERSION}"

0 commit comments

Comments
 (0)