Skip to content

Commit

Permalink
Merge pull request #2 from Sid220/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
Sid220 committed Sep 26, 2023
2 parents 6583e02 + 5fd06ed commit 72b6b75
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions gitbump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set -e

git fetch --tags # checkout action does not get these

# git describe has issues with GitHub Actions: https://github.com/treeder/firetils/commit/160ef4560d8855c9c05f4cae207baeb71b7791f3/checks?check_suite_id=414542684
# oldv=$(git describe --match "v[0-9]*" --abbrev=0 HEAD)
# This new way seems to work better and avoids the issue above:
# -v:refname is a version sort
oldv=$(git tag --sort=-v:refname --list "v[0-9]*" | head -n 1)
echo "oldv: $oldv"

# if there is no version tag yet, let's start at 0.0.0
if [ -z "$oldv" ]; then
echo "No existing version, starting at 0.0.0"
oldv="0.0.0"
fi

newv=$(docker run --rm -v "$PWD":/app treeder/bump --input "$oldv" patch)
echo "newv: $newv"

echo "Creating tag..."
git tag -a "v$newv" -m "version $newv"
echo "Pushing tag to github..."
echo "$0"
git push --follow-tags "https://sid220:$1@github.com/Sid220/docker-apriltag-localisation.git"

0 comments on commit 72b6b75

Please sign in to comment.