From 96eec35b1cbfcdcbdf86688f493a4c224bf95efa Mon Sep 17 00:00:00 2001 From: beac0n Date: Wed, 25 Sep 2024 23:06:27 +0200 Subject: [PATCH] remove VERSION file --- VERSION | 1 - version.sh | 10 ++-------- 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 VERSION diff --git a/VERSION b/VERSION deleted file mode 100644 index d4dfa56..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -v0.3.0 \ No newline at end of file diff --git a/version.sh b/version.sh index d8525b1..01a63c7 100755 --- a/version.sh +++ b/version.sh @@ -5,13 +5,8 @@ USAGE="Usage: $0 {major|minor|patch}" if [ "$#" -ne 1 ]; then printf "%s\n" "$USAGE" exit 1 -elif [ ! -f VERSION ]; then - VERSION="0.0.0" -else - VERSION=$(cat VERSION) - VERSION=${VERSION#v} -fi +VERSION=$(grep '^version = ' Cargo.toml | cut -d '"' -f 2) MAJOR=$(printf "%s" "$VERSION" | cut -d '.' -f 1) MINOR=$(printf "%s" "$VERSION" | cut -d '.' -f 2) PATCH=$(printf "%s" "$VERSION" | cut -d '.' -f 3) @@ -27,12 +22,11 @@ NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}" NEW_VERSION_SEMVER=${NEW_VERSION#v} sed -i -E "s/^version = \"[0-9]+\.[0-9]+\.[0-9]+\"/version = \"$NEW_VERSION_SEMVER\"/" Cargo.toml -printf "%s" "$NEW_VERSION" > VERSION git cliff --unreleased --tag "$NEW_VERSION_SEMVER" --prepend CHANGELOG.md printf "Updated version to %s\n" "$NEW_VERSION" cargo update -git add VERSION Cargo.toml Cargo.lock CHANGELOG.md +git add Cargo.toml Cargo.lock CHANGELOG.md git commit -m "Bump version to ${NEW_VERSION}" git tag "$NEW_VERSION"