Initialize LLVM submodule first

This commit is contained in:
kvp
2025-12-18 12:07:28 -05:00
parent 89462d6da3
commit 541a0560e7
+13 -17
View File
@@ -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