From dd702fb7b1575e97e1f8f51689fd03010ed17e44 Mon Sep 17 00:00:00 2001 From: Mikhail Privalov Date: Tue, 27 Sep 2022 08:35:14 +0300 Subject: [PATCH] create tag auto --- .github/workflows/createTag.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/createTag.yml diff --git a/.github/workflows/createTag.yml b/.github/workflows/createTag.yml new file mode 100644 index 0000000000..e9818e20a3 --- /dev/null +++ b/.github/workflows/createTag.yml @@ -0,0 +1,29 @@ +on: + push: + branches: [ develop ] + paths: + - pyproject.toml + - laboratory/__init__.py + +name: Make new tag +jobs: + createTag: + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - name: Check if version is changed + id: version_check + run: | + content=`cat pyproject.toml` + version=`echo $content | grep -oP '(?<=version = ").*(?=")'` + echo "::set-output name=version::v$version" + - name: Check if tag exists + id: tag_check + run: | + tag=`git tag -l ${{ steps.version_check.outputs.version }}` + echo "::set-output name=tag::$tag" + - name: Create tag if not exists + if: ${{ steps.tag_check.outputs.tag == '' }} + run: | + git tag ${{ steps.version_check.outputs.version }} + git push origin ${{ steps.version_check.outputs.version }}