From 3b67992aa9e4747b6233768029dfe971794daab7 Mon Sep 17 00:00:00 2001 From: Degamisu Date: Sun, 21 Jan 2024 12:03:32 -0500 Subject: [PATCH] Update build_and_release.yml --- .github/workflows/build_and_release.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index 2f48f67..386463b 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -42,10 +42,16 @@ jobs: sudo apt-get update sudo apt-get install -y libncurses5-dev pip install -r requirements.txt - + - name: Get latest release tag id: get_latest_tag - run: echo "::set-output name=tag::$(git describe --tags $(git rev-list --tags --max-count=1))" + run: | + latest_tag=$(git tag -l | sort -V | tail -n 1) + if [ -z "$latest_tag" ]; then + echo "::set-output name=tag::v1.0.2" # Set a default tag if no tags are found + else + echo "::set-output name=tag::$latest_tag" + fi - name: Increment version id: increment_version