Skip to content

dbp-557- create generated tag , if not exist start with 1 #12

dbp-557- create generated tag , if not exist start with 1

dbp-557- create generated tag , if not exist start with 1 #12

name: Versioning
on:
push:
branches:
- dbp-557-implement-semV # main
jobs:
version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Get current version
run: |
git fetch --tags
version=$(git describe --tags --always)
if [[ "$version" =~ ^[0-9]+$ ]];
echo "VERSION=$version" >> $GITHUB_ENV
else
echo "VERSION=1" >> $GITHUB_ENV
fi
- name: Determine version type
run: |
version=${{ env.VERSION }}
new_version=$(($version + 1))
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
- name: Create new tag
if: ${{ github.ref == 'refs/heads/dbp-557-implement-semV' }} # main
uses: anothrNick/github-tag-action@a2c70ae13a881faf2b4953baaa9e49731997ab36
with:
tag: ${{ env.NEW_VERSION }}
message: 'New version ${{ env.NEW_VERSION }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}