fix: support pre-release identifiers in tags

This commit is contained in:
Michael Bolin
2025-06-28 15:26:14 -07:00
parent 3f9093ad09
commit ec0d949528
2 changed files with 8 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
#!/bin/bash
set -euo pipefail
set -x
# Change to the root of the Cargo workspace.
cd "$(dirname "${BASH_SOURCE[0]}")/.."
@@ -15,7 +16,11 @@ fi
CURRENT_BRANCH=$(git symbolic-ref --short -q HEAD)
# Create a new branch for the release and make a commit with the new version.
VERSION=$(printf '0.0.%d' "$(date +%y%m%d%H%M)")
if [ $# -ge 1 ]; then
VERSION="$1"
else
VERSION=$(printf '0.0.%d' "$(date +%y%m%d%H%M)")
fi
TAG="rust-v$VERSION"
git checkout -b "$TAG"
perl -i -pe "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml