fix: support pre-release identifiers in tags (#1422)

Had to update the regex in the GitHub workflow to allow suffixes like
`-alpha.4`.

Successfully ran:

```
./scripts/create_github_release.sh 0.1.0-alpha.4
```

to create
https://github.com/openai/codex/releases/tag/codex-rs-b289c9207090b2e27494545d7b5404e063bd86f3-1-rust-v0.1.0-alpha.4

and verified that when I run `codex --version`, it prints `codex-cli
0.1.0-alpha.4`.
This commit is contained in:
Michael Bolin
2025-06-28 16:05:53 -07:00
committed by GitHub
parent 1b7c8d2569
commit f30bf4bbcf
2 changed files with 14 additions and 6 deletions

View File

@@ -2,6 +2,13 @@
set -euo pipefail
# By default, this script uses a version based on the current date and time.
# If you want to specify a version, pass it as the first argument. Example:
#
# ./scripts/create_github_release.sh 0.1.0-alpha.4
#
# The value will be used to update the `version` field in `Cargo.toml`.
# Change to the root of the Cargo workspace.
cd "$(dirname "${BASH_SOURCE[0]}")/.."
@@ -15,7 +22,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