Skip to content

Commit

Permalink
create tag auto
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailprivalov committed Sep 27, 2022
1 parent 778860c commit dd702fb
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/createTag.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit dd702fb

Please sign in to comment.