Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add from and to params to increment-version #10723

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions resources/build/increment-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ gitbranch=`git branch --show-current`

FORCE=0
HISTORY_FORCE=
fromversion=
toversion=

if [[ $# -gt 0 ]]; then
if [[ "$1" == "-f" ]]; then
Expand All @@ -42,13 +44,14 @@ fi
if [[ $# -gt 0 ]]; then
# We want the action to specify the branch as a consistency check
# for now at least.

action=$1
if [[ $# -gt 1 ]]; then
base=$2
shift
else
action=help
fi
shift

if [[ $action == commit ]]; then
if [ "$base" != "master" ] && [ "$base" != "beta" ] && [[ ! "$base" =~ ^stable-[0-9]+\.[0-9]+$ ]]; then
Expand All @@ -60,6 +63,13 @@ if [[ $# -gt 0 ]]; then
echo "Branch doesn't match currently checked out branch."
exit 2
fi

# commit action parameters
if [[ $# -gt 0 ]]; then
# next two parameters are --from and --to
fromversion="$1"
toversion="$2"
fi
fi
else
action="increment"
Expand Down Expand Up @@ -93,7 +103,11 @@ npm ci
echo "increment-version.sh: running resources/build/version"
pushd "$KEYMAN_ROOT"
ABORT=0
node resources/build/version/build/src/index.js history version -t "$GITHUB_TOKEN" -b "$base" $HISTORY_FORCE || ABORT=$?
if [[ -z "$fromversion" ]]; then
node resources/build/version/build/src/index.js history version -t "$GITHUB_TOKEN" -b "$base" $HISTORY_FORCE || ABORT=$?
else
node resources/build/version/build/src/index.js history version -t "$GITHUB_TOKEN" -b "$base" $HISTORY_FORCE --from "$fromversion" --to "$toversion" || ABORT=$?
fi

if [[ $ABORT = 50 ]]; then
if [[ $FORCE = 0 ]]; then
Expand Down
Loading