CodeQL: install platform specific CodeQL bundle

This should reduce the size of the CodeQL bundle by only including the
platform specific CodeQL CLI and libraries, rather than the full set
of CodeQL CLI and libraries for all platforms.
This commit is contained in:
Arthur Baars
2025-06-23 08:05:29 +00:00
parent 98413b96dd
commit 60599408e4
3 changed files with 4 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ bundle_tag_name="codeql-bundle-v$bundle_version"
echo "Downloading CodeQL bundle $bundle_version..." echo "Downloading CodeQL bundle $bundle_version..."
# Note that this is the all-platforms CodeQL bundle, to support scenarios where customers run # Note that this is the all-platforms CodeQL bundle, to support scenarios where customers run
# different operating systems within containers. # different operating systems within containers.
archive_path=$(download_with_retry "https://github.com/github/codeql-action/releases/download/$bundle_tag_name/codeql-bundle.tar.gz") archive_path=$(download_with_retry "https://github.com/github/codeql-action/releases/download/$bundle_tag_name/codeql-bundle-osx64.tar.gz")
codeql_toolcache_path=$AGENT_TOOLSDIRECTORY/CodeQL/$bundle_version/x64 codeql_toolcache_path=$AGENT_TOOLSDIRECTORY/CodeQL/$bundle_version/x64
mkdir -p "$codeql_toolcache_path" mkdir -p "$codeql_toolcache_path"

View File

@@ -30,7 +30,7 @@ bundle_tag_name="codeql-bundle-v$bundle_version"
echo "Downloading CodeQL bundle $bundle_version..." echo "Downloading CodeQL bundle $bundle_version..."
# Note that this is the all-platforms CodeQL bundle, to support scenarios where customers run # Note that this is the all-platforms CodeQL bundle, to support scenarios where customers run
# different operating systems within containers. # different operating systems within containers.
codeql_archive=$(download_with_retry "https://github.com/github/codeql-action/releases/download/$bundle_tag_name/codeql-bundle.tar.gz") codeql_archive=$(download_with_retry "https://github.com/github/codeql-action/releases/download/$bundle_tag_name/codeql-bundle-linux64.tar.gz")
codeql_toolcache_path="$AGENT_TOOLSDIRECTORY/CodeQL/$bundle_version/x64" codeql_toolcache_path="$AGENT_TOOLSDIRECTORY/CodeQL/$bundle_version/x64"
mkdir -p "$codeql_toolcache_path" mkdir -p "$codeql_toolcache_path"

View File

@@ -31,7 +31,7 @@ $tagName = "codeql-bundle-v" + $cliVersion
Write-Host "Downloading CodeQL bundle $($cliVersion)..." Write-Host "Downloading CodeQL bundle $($cliVersion)..."
# Note that this is the all-platforms CodeQL bundle, to support scenarios where customers run # Note that this is the all-platforms CodeQL bundle, to support scenarios where customers run
# different operating systems within containers. # different operating systems within containers.
$codeQLBundlePath = Invoke-DownloadWithRetry "https://github.com/github/codeql-action/releases/download/$($tagName)/codeql-bundle.tar.gz" $codeQLBundlePath = Invoke-DownloadWithRetry "https://github.com/github/codeql-action/releases/download/$($tagName)/codeql-bundle-win64.tar.gz"
$downloadDirectoryPath = (Get-Item $codeQLBundlePath).Directory.FullName $downloadDirectoryPath = (Get-Item $codeQLBundlePath).Directory.FullName
$codeQLToolcachePath = Join-Path $env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath $cliVersion | Join-Path -ChildPath "x64" $codeQLToolcachePath = Join-Path $env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath $cliVersion | Join-Path -ChildPath "x64"
@@ -39,7 +39,7 @@ New-Item -Path $codeQLToolcachePath -ItemType Directory -Force | Out-Null
Write-Host "Unpacking the downloaded CodeQL bundle archive..." Write-Host "Unpacking the downloaded CodeQL bundle archive..."
Expand-7ZipArchive -Path $codeQLBundlePath -DestinationPath $downloadDirectoryPath Expand-7ZipArchive -Path $codeQLBundlePath -DestinationPath $downloadDirectoryPath
$unGzipedCodeQLBundlePath = Join-Path $downloadDirectoryPath "codeql-bundle.tar" $unGzipedCodeQLBundlePath = Join-Path $downloadDirectoryPath "codeql-bundle-win64.tar"
Expand-7ZipArchive -Path $unGzipedCodeQLBundlePath -DestinationPath $codeQLToolcachePath Expand-7ZipArchive -Path $unGzipedCodeQLBundlePath -DestinationPath $codeQLToolcachePath
Write-Host "CodeQL bundle at $($codeQLToolcachePath) contains the following directories:" Write-Host "CodeQL bundle at $($codeQLToolcachePath) contains the following directories:"