Skip to content

Merge pull request #525 from paritytech/dependabot/cargo/serde-1.0.188 #80

Merge pull request #525 from paritytech/dependabot/cargo/serde-1.0.188

Merge pull request #525 from paritytech/dependabot/cargo/serde-1.0.188 #80

name: Set version tag
on:
push:
branches:
- master
jobs:
set-version-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- name: Push new version if exists
run: |
LATEST_TAG=$(git describe --tags --abbrev=0)
echo "Latest tag is ${LATEST_TAG}"
CURRENT_TAG=v$(awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2) }' Cargo.toml)
echo "Current tag is ${CURRENT_TAG}"
if [ "$LATEST_TAG" = "$CURRENT_TAG" ]; then
echo "The version hasn't changed"
else
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git tag $CURRENT_TAG
git push origin $CURRENT_TAG
echo "The version has updated"
fi