Skip to content

Commit 15c40d1

Browse files
authored
chore: Update package version upon release action (#965)
* chore: Update package version upon release * fix: Ensure that previous version fully matches the expected format
1 parent c86f014 commit 15c40d1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/linutil.yml

+12
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ jobs:
3939
with:
4040
targets: x86_64-unknown-linux-musl
4141

42+
- name: Update package version
43+
run: |
44+
prev_version=$(grep 'version' Cargo.toml | head -n +1 | cut -d'"' -f2)
45+
if ! echo " ${prev_version} " | grep -q -E ' [0-9]{2}\.[0-9]{2}\.[0-9]{2} '; then
46+
echo "Could not accurately determine the previous version"
47+
exit 1
48+
fi
49+
new_version=$(date +"%y.%m.%d")
50+
# The TUI depends upon linutil_core, which has its version updated
51+
sed -i "s/version = \"${prev_version}\"/version = \"${new_version}\"/g" Cargo.toml tui/Cargo.toml
52+
shell: bash
53+
4254
- name: Install cross-rs for cross-compilation
4355
run: cargo install cross
4456

0 commit comments

Comments
 (0)