mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 03:55:22 +00:00
10 lines
389 B
Bash
Executable File
10 lines
389 B
Bash
Executable File
#! /bin/bash
|
|
version=`git diff HEAD^..HEAD -- "$(git rev-parse --show-toplevel)"/pyproject.toml | grep -m 1 '^\+.*version' | sed -s 's/[^A-Z0-9\.\-]//g'`
|
|
|
|
if [[ ! $version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(\-[A-Z]+\.[0-9]+)?$ ]]; then
|
|
echo -e "Skip tag: invalid version 'v$version'"
|
|
exit 1
|
|
fi
|
|
|
|
git tag -a "v$version" -m "`git log -1 --format=%s`"
|
|
echo "Created a new tag, v$version" |