Skip to content

add tags

add tags #6

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- "src/GeoLite2-City.mmdb"
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)"
echo "$revlist"
if [ -z "$revlist" ]; then
latestVersion="1.0.0"
else
latestVersion="$(git describe --tags "$revlist")"
fi
echo "$latestVersion"
latestVersionPrefix="$(awk -F'.' '{ $NF=""; print }' <<< "$latestVersion" | tr " " ".")"
echo "$latestVersionPrefix"
latestMinorVersion="$(sed "s/$latestVersionPrefix//g" <<< "$latestVersion")"
echo "$latestMinorVersion"
newMinorVersion=$(( $latestMinorVersion + 1 ))
echo "$newMinorVersion"
newVersion="$latestVersionPrefix$newMinorVersion"
echo "$newVersion"
git tag "$newVersion"
git push origin "$newVersion" || exit 1