From 9a202109e07b18ac63444c6d016495b0ddf6b4f4 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Wed, 30 Oct 2024 08:31:48 -0500 Subject: make sure to tag repo when running changeset publish Signed-off-by: Matt Strapp --- contrib/tag-repo | 23 +++++++++++++++++++++++ contrib/version-bump | 17 +---------------- 2 files changed, 24 insertions(+), 16 deletions(-) create mode 100755 contrib/tag-repo mode change 100644 => 100755 contrib/version-bump (limited to 'contrib') diff --git a/contrib/tag-repo b/contrib/tag-repo new file mode 100755 index 0000000..09ca6a9 --- /dev/null +++ b/contrib/tag-repo @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +if [ -z "$GIT_TAG" ]; then + echo "GIT_TAG is not set, pulling 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 + +# remove the snapshot from gradle +sed -i "s/-SNAPSHOT//g" gradle.properties + +# bump the main package.json too +jq ".version = \"$GIT_TAG\"" package.json | sponge package.json \ No newline at end of file diff --git a/contrib/version-bump b/contrib/version-bump old mode 100644 new mode 100755 index 09ca6a9..fb0b930 --- a/contrib/version-bump +++ b/contrib/version-bump @@ -5,19 +5,4 @@ if [ -z "$GIT_TAG" ]; then 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 - -# remove the snapshot from gradle -sed -i "s/-SNAPSHOT//g" gradle.properties - -# bump the main package.json too -jq ".version = \"$GIT_TAG\"" package.json | sponge package.json \ No newline at end of file +git tag v"$GIT_TAG" -- cgit v1.2.3