mirror of https://github.com/pulumi/pulumi.git
18 lines
435 B
Bash
Executable File
18 lines
435 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
>&2 echo "::group::Get version"
|
|
trap ">&2 echo '::endgroup::'" EXIT # bash equivalent of defer func()
|
|
|
|
PREVIOUS_VERSION="${1:-""}"
|
|
if [ -z "$PREVIOUS_VERSION" ]; then
|
|
PREVIOUS_VERSION="$(.github/scripts/get-version)"
|
|
fi
|
|
|
|
# Semver minor: increment field 2 and reset field 3
|
|
# 3.39.3 -> 3.40.0
|
|
VERSION="$(echo -n "$PREVIOUS_VERSION" | awk -F. -v OFS=. '{$2 += 1 ; $3 = 0 ; print}')"
|
|
|
|
echo -n "$VERSION"
|