diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index b6eaaaa..7446986 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,10 +12,20 @@ jobs: version: ${{ steps.get_version.outputs.version }} steps: - uses: actions/checkout@v4.1.2 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Debug - List tags + run: git tag -l + - name: Debug - Show commits + run: git log --oneline - name: Get latest tag id: get_version - run: echo "version=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV - + run: | + tag=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null || echo "v0.0.1") + echo "version=$tag" >> $GITHUB_ENV + echo "::set-output name=version::$tag" + echo "Resolved version: $tag" + build: needs: get_version runs-on: ubuntu-latest