Skip to content

Commit 152aeb6

Browse files
authored
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 ```
1 parent de6ffd2 commit 152aeb6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/release.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ else
2525
echo "var is set to '$ICEBERG_VERSION'"
2626
fi
2727

28+
# Validate version format (e.g., 1.0.0)
29+
if [[ ! "$ICEBERG_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
30+
echo "Error: ICEBERG_VERSION ($ICEBERG_VERSION) must be in the format: <number>.<number>.<number>"
31+
exit 1
32+
fi
33+
2834
# tar source code
2935
release_version=${ICEBERG_VERSION}
3036
# rc versions

0 commit comments

Comments
 (0)