From 220b7c8898df098c95fd851f9a1aa0357fe40143 Mon Sep 17 00:00:00 2001 From: Hitesh Nayak Date: Fri, 29 Nov 2024 14:46:06 +0530 Subject: [PATCH] feat(ci): add version bump script --- .github/workflows/release.yml | 3 ++- ci/bump-version.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 ci/bump-version.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61e6e17..fbb498e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,10 +3,11 @@ name: Build and Release on: push: tags: - - "v*" + - "*" permissions: contents: write + pull-requests: read jobs: release: diff --git a/ci/bump-version.sh b/ci/bump-version.sh new file mode 100755 index 0000000..585a941 --- /dev/null +++ b/ci/bump-version.sh @@ -0,0 +1,18 @@ +#!/bin/bash +if [ $# -lt 2 ]; then + echo "not enough arguments" + exit 1 +elif [ $# -gt 2 ]; then + echo "too many arguments" + exit 1 +fi + +echo "bump version from $1 to $2" + +# change version in galaxy.yml +sed -i "s/sonar.projectVersion=$1/sonar.projectVersion=$2/1" sonar-project.properties + +# push new version to scm +git add . +git commit -m "chore(dev): bump version to $2" +git tag $2