Fix auto build.yml
@@ -164,18 +164,23 @@ jobs:
git fetch --tags
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "latest tag: $latest_tag"
- new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
- if [ -n "${{ inputs.versionBump }}" ]
+ if [[ -z "${{ inputs.versionBump }}" ]]
then
- case ${{ inputs.versionBump }} in
- "minor")
+ version="patch"
+ else
+ version="${{ inputs.versionBump }}"
+ fi
+ case $version in
+ minor)
new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b+1 , 0)}')
;;
- "major")
+ major)
new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a+1, 0 , 0)}')
;;
+ patch)
+ new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
+ ;;
esac
- fi
echo "new tag: $new_tag"
echo "version=$new_tag" >> $GITHUB_OUTPUT
