From 0d76bb557d5e1e04c87766020df35c34cd6e79dd Mon Sep 17 00:00:00 2001 From: Darek Margas <71180450+darek-margas@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:30:08 +1000 Subject: [PATCH] Update build_ubuntu.yml --- .github/workflows/build_ubuntu.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_ubuntu.yml b/.github/workflows/build_ubuntu.yml index 1eb14d1..ea62106 100644 --- a/.github/workflows/build_ubuntu.yml +++ b/.github/workflows/build_ubuntu.yml @@ -12,7 +12,9 @@ jobs: steps: - uses: actions/checkout@v3 - + with: + fetch-depth: 0 # This ensures all history and tags are fetched + - name: Install dependencies run: | sudo apt-get update @@ -29,8 +31,13 @@ jobs: make test - name: Prepare package files run: | - # Get the latest tag - LATEST_TAG=$(git describe --tags --abbrev=0) + # Try to get the latest tag, use a default if none exists + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0") + + # If no tag was found, use the short commit hash + if [ "$LATEST_TAG" = "v0.1.0" ]; then + LATEST_TAG=$(git rev-parse --short HEAD) + fi cd source mkdir -p debian