summaryrefslogtreecommitdiff
path: root/.github/workflows/update-code-version.yml
diff options
context:
space:
mode:
authorRoi Glinik <groi.tech@gmail.com>2023-08-21 23:58:18 -0700
committerGitHub <noreply@github.com>2023-08-21 23:58:18 -0700
commit9cba7cec2e9be89c9ea2d349b65e48460f6c1b5e (patch)
treecdf1ed08b4f7fc6e6367e0d7fa3933203d4278ea /.github/workflows/update-code-version.yml
parent8e319870512d2abc7049b0e09337f1de807626b6 (diff)
parentf5232f120aa9254e32dfedfe9f162744e45b74cb (diff)
Merge pull request #126 from robusta-dev/update-version-on-tag
Add action to update version on new tag
Diffstat (limited to '.github/workflows/update-code-version.yml')
-rw-r--r--.github/workflows/update-code-version.yml34
1 files changed, 34 insertions, 0 deletions
diff --git a/.github/workflows/update-code-version.yml b/.github/workflows/update-code-version.yml
new file mode 100644
index 0000000..019d0a1
--- /dev/null
+++ b/.github/workflows/update-code-version.yml
@@ -0,0 +1,34 @@
+# @format
+
+name: Update Version
+
+on:
+ push:
+ tags:
+ - "v*"
+
+jobs:
+ update-version:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v2
+
+ - name: Extract version from tag
+ run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
+
+ - name: Update version in pyproject.toml
+ run: |
+ sed -i "s/version = \".*\"/version = \"$VERSION\"/" pyproject.toml
+
+ - name: Update version in robusta_krr/__init__.py
+ run: |
+ sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/" robusta_krr/__init__.py
+
+ - name: Commit and push
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+ git add pyproject.toml robusta_krr/__init__.py
+ git commit -m "Update version to $VERSION" && git push