From 78149704eb7d5b13e5be6900e9f998efbf96655a Mon Sep 17 00:00:00 2001 From: Aleks Knezevic Date: Fri, 20 Sep 2024 01:20:15 +0000 Subject: [PATCH] Add tag and get latest tag step --- .github/workflows/build-and-test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 323dd64..47599f7 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -71,6 +71,18 @@ jobs: name: install-artifacts path: ${{ steps.strings.outputs.build-output-dir }}/artifact.tar + - name: Get the latest tag + shell: bash + run: | + latest_tag=$(git describe --tags --abbrev=0) + latest_tag=${latest_tag#v} + echo "latest_tag=$latest_tag" >> $GITHUB_ENV + commit_count=$(git rev-list ${{ env.latest_tag }}..HEAD --count) + echo "commit_count=$commit_count" >> $GITHUB_ENV + version="${{ env.latest_tag }}.${{ env.commit_count }}" + echo "version=$version" >> $GITHUB_ENV + echo $version + # Run tests on TT hardware