Skip to content

test

test #4

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: |
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"
echo "$newVersion"
git tag "$newVersion"
git push origin "$newVersion" || exit 1