diff --git a/.github/actions/get-llvm/action.yml b/.github/actions/get-llvm/action.yml index c565735..1413a23 100644 --- a/.github/actions/get-llvm/action.yml +++ b/.github/actions/get-llvm/action.yml @@ -20,26 +20,22 @@ runs: shell: bash run: | if [ -z "${{ inputs.version }}" ]; then - # Get the full version from the LLVM submodule - if [ -d "llvm/.git" ]; then - cd llvm - # Try to get the most recent tag (e.g., "llvmorg-18.1.8") - LLVM_TAG=$(git describe --tags --abbrev=0 2>/dev/null) - if [ -n "$LLVM_TAG" ]; then - echo "Detected LLVM version from submodule: $LLVM_TAG" - # Convert "llvmorg-x.y.z" to "llvm-x.y.z" - LLVM_VERSION=$(echo "$LLVM_TAG" | sed 's/^llvmorg-/llvm-/') - echo "Detected LLVM version from submodule: $LLVM_VERSION" - echo "version_prefix=$LLVM_VERSION" >> $GITHUB_OUTPUT - else - echo "Could not detect LLVM version from submodule, will use latest release" - echo "version_prefix=" >> $GITHUB_OUTPUT - fi - cd .. + # Get the full version from the LLVM submodule. + git submodule update --init --recursive --depth 1 + cd llvm + # Try to get the most recent tag (e.g., "llvmorg-18.1.8") + LLVM_TAG=$(git describe --tags --abbrev=0 2>/dev/null) + if [ -n "$LLVM_TAG" ]; then + echo "Detected LLVM version from submodule: $LLVM_TAG" + # Convert "llvmorg-x.y.z" to "llvm-x.y.z" + LLVM_VERSION=$(echo "$LLVM_TAG" | sed 's/^llvmorg-/llvm-/') + echo "Detected LLVM version from submodule: $LLVM_VERSION" + echo "version_prefix=$LLVM_VERSION" >> $GITHUB_OUTPUT else - echo "LLVM submodule not initialized, will use latest release" + echo "Could not detect LLVM version from submodule, will use latest release" echo "version_prefix=" >> $GITHUB_OUTPUT fi + cd .. else echo "Using explicitly provided version: ${{ inputs.version }}" echo "version_prefix=${{ inputs.version }}" >> $GITHUB_OUTPUT