aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/version-bump
blob: fff89c25a5870db25935d18c23a65c245dd4fe55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

if [ -z "$GIT_TAG" ]; then
  echo "GIT_TAG is not set, guessing from changeset"
  GIT_TAG=$(jq -r '.version' src/packages/locusts/package.json)
fi

OLD_TAG=$(jq -r '.version' package.json)

echo "Bumping version from $OLD_TAG to $GIT_TAG"

rg "$OLD_TAG" --files-with-matches --iglob \!\*lock\* --iglob \!go.mod --iglob \!deno.json --iglob \!package.json --iglob \!\*.md "$(pwd)" | xargs sed -i "s/$OLD_TAG/$GIT_TAG/g"

# fiddle with autotools
AUTOTOOLS_TAG=${GIT_TAG//\./:}
OLD_TAG=${OLD_TAG//\./:}

sed -i "s/$GIT_TAG/$AUTOTOOLS_TAG/g" GNUmakefile.am