From 20386fe6b35d7952119c9018cd23cd0e1add4f41 Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Tue, 8 Oct 2024 18:38:51 -0500 Subject: [PATCH] Fix Ubuntu CI by extracting latest Tag instead of organization variable --- .github/workflows/ubuntu.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 30b088e574..4be0792e4f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -17,15 +17,42 @@ on: - released jobs: + get-tag: + # Pre-job to fetch the latest tag + runs-on: ubuntu-latest + outputs: + major: ${{ steps.extract_tag.outputs.major }} + minor: ${{ steps.extract_tag.outputs.minor }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Ensure all history and tags are fetched + + - name: Get latest tag + id: extract_tag + run: | + latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "Latest tag: $latest_tag" + + # Extract major and minor version from the tag + IFS='.' read -r major minor patch <<< "$latest_tag" + echo "Major: $major" + echo "Minor: $minor" + + # Set as output variables + echo "::set-output name=major::$major" + echo "::set-output name=minor::$minor" ci: name: ${{ matrix.distro }} + needs: get-tag # Make sure the 'ci' job waits for the 'get-tag' job to finish runs-on: ubuntu-latest strategy: fail-fast: false matrix: distro: [focal, jammy, noble] container: - image: ghcr.io/tesseract-robotics/trajopt:${{ matrix.distro }}-${{ vars.TESSERACT_DOCKER_TAG }} + image: ghcr.io/tesseract-robotics/trajopt:${{ matrix.distro }}-${{ needs.get-tag.outputs.major }}.${{ needs.get-tag.outputs.minor }} env: CCACHE_DIR: "$GITHUB_WORKSPACE/${{ matrix.distro }}/.ccache" DEBIAN_FRONTEND: noninteractive