Skip to content

readme

readme #9

Workflow file for this run

name: CI
on:
push:
branches:
- "**"
tags-ignore:
- "**"
workflow_dispatch:
jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: create tag
run: |
git fetch --tags origin
revlist="$(git rev-list --tags --max-count=1)"
if [ -z "$revlist" ]; then
latestVersion="1.0.0"
else
latestVersion="$(git describe --tags "$revlist")"
fi
latestVersionPrefix="$(awk -F'.' '{ $NF=""; print }' <<< "$latestVersion" | tr " " ".")"
latestMinorVersion="$(sed "s/$latestVersionPrefix//g" <<< "$latestVersion")"
newMinorVersion=$(( $latestMinorVersion + 1 ))
newVersion="$latestVersionPrefix$newMinorVersion"
git tag "$newVersion"
git push origin "$newVersion" || exit 1