mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-06-27 02:30:08 +00:00

Given the tendency for shell scripts to easily enter into a few levels of indentation and long line lengths, update the default to 2 spaces.
26 lines
897 B
Bash
Executable File
26 lines
897 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eux
|
|
|
|
# Function to check if the current version is a non-dev version
|
|
function is_non_dev_version {
|
|
local VERSION="$1"
|
|
[[ "$VERSION" != *"-dev"* ]]
|
|
}
|
|
|
|
# Function to get the version from the current main branch
|
|
function get_main_branch_version {
|
|
local VERSION
|
|
git fetch origin main
|
|
VERSION=$(git show origin/main:unstructured/__version__.py | grep -o -m 1 -E "(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[a-zA-Z0-9.-]+)?")
|
|
echo "$VERSION"
|
|
}
|
|
|
|
# Get the current version from the file
|
|
CURRENT_VERSION=$(grep -o -m 1 -E "(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-dev[0-9]+)?" "unstructured/__version__.py")
|
|
|
|
# Check if the current version is a non-dev version and not matching the main version
|
|
if is_non_dev_version "$CURRENT_VERSION" && [ "$(get_main_branch_version)" != "$CURRENT_VERSION" ]; then
|
|
echo "New release version: $CURRENT_VERSION"
|
|
fi
|