This is an automated email from the ASF dual-hosted git repository.
liurenjie1024 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git
The following commit(s) were added to refs/heads/main by this push:
new 152aeb645 infra: release script, validate proper ICEBERG_VERSION
variable (#1956)
152aeb645 is described below
commit 152aeb645332ba9962a4e7f8a633b8f409e9a21a
Author: Kevin Liu <[email protected]>
AuthorDate: Tue Dec 23 15:58:48 2025 -0800
infra: release script, validate proper ICEBERG_VERSION variable (#1956)
## Which issue does this PR close?
- Closes #.
## What changes are included in this PR?
Add a check that the input `ICEBERG_VERSION` variable is in the proper
format, i.e. `0.8.0`. Otherwise, the source directory and zip file will
have the wrong name
## Are these changes tested?
Added these 3 lines:
```
echo "Release version: $release_version"
echo "Git branch: $git_branch"
echo "Source directory: apache-iceberg-rust-$release_version"
```
This PR:
```
➜ iceberg-rust git:(kevinjqliu/validate-version) ✗ ICEBERG_VERSION=rc.1
./scripts/release.sh
var is set to 'rc.1'
Error: ICEBERG_VERSION (rc.1) must be in the format:
<number>.<number>.<number>
➜ iceberg-rust git:(kevinjqliu/validate-version) ✗ ICEBERG_VERSION=0.8.0
./scripts/release.sh
var is set to '0.8.0'
Release version: 0.8.0
Git branch: release-0.8.0-rc.1
Source directory: apache-iceberg-rust-0.8.0
```
main:
```
➜ iceberg-rust git:(kevinjqliu/validate-version) ✗ ICEBERG_VERSION=rc.1
./scripts/release.sh
var is set to 'rc.1'
Release version: rc.1
Git branch: release-rc.1-rc.1
Source directory: apache-iceberg-rust-rc.1
➜ iceberg-rust git:(kevinjqliu/validate-version) ✗ ICEBERG_VERSION=0.8.0
./scripts/release.sh
var is set to '0.8.0'
Release version: 0.8.0
Git branch: release-0.8.0-rc.1
Source directory: apache-iceberg-rust-0.8.0
```
---
scripts/release.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/release.sh b/scripts/release.sh
index a790cdd8d..e4cee342d 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -25,6 +25,12 @@ else
echo "var is set to '$ICEBERG_VERSION'"
fi
+# Validate version format (e.g., 1.0.0)
+if [[ ! "$ICEBERG_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ echo "Error: ICEBERG_VERSION ($ICEBERG_VERSION) must be in the format:
<number>.<number>.<number>"
+ exit 1
+fi
+
# tar source code
release_version=${ICEBERG_VERSION}
# rc versions