Skip to content

ci: update ci image with rust 1.81.0 (#825) #307

ci: update ci image with rust 1.81.0 (#825)

ci: update ci image with rust 1.81.0 (#825) #307

name: Set version tag
on:
push:
branches:
- master
jobs:
set-version-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
- name: Push new version if exists
run: |
LATEST_TAG=$(git describe --tags --abbrev=0)
echo "Latest tag is ${LATEST_TAG}"
CURRENT_TAG=v$(cat Cargo.toml | grep -A1 workspace.package | grep version | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
echo "Current tag is ${CURRENT_TAG}"
if [ "$LATEST_TAG" = "$CURRENT_TAG" ]; then
echo "The version hasn't changed"
else
git tag $CURRENT_TAG
git push origin $CURRENT_TAG
echo "The version has updated"
fi