diff --git a/.github/workflows/powershell-pr-check.yml b/.github/workflows/powershell-pr-check.yml index 241fc012318..d6ab9098980 100644 --- a/.github/workflows/powershell-pr-check.yml +++ b/.github/workflows/powershell-pr-check.yml @@ -26,7 +26,7 @@ jobs: - name: Install PowerShell run: | $path = Split-Path (Get-Command codeql).Source - ./powershell/build.ps1 $path + ./powershell/build-win64.ps1 $path - name: Run QL tests run: | codeql test run --threads=0 powershell/ql/test diff --git a/powershell/build-linux64.ps1 b/powershell/build-linux64.ps1 new file mode 100644 index 00000000000..2bfa2c9880c --- /dev/null +++ b/powershell/build-linux64.ps1 @@ -0,0 +1,18 @@ +param ( + [Parameter(Mandatory=$true)][string]$cliFolder +) + +$toolsLinux64Folder = Join-Path (Join-Path (Join-Path $cliFolder "powershell") "tools") "linux64" +dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsLinux64Folder -r linux-x64 +if ($LASTEXITCODE -ne 0) { + Write-Host "Build failed" + exit 1 +} + +$powershellFolder = Join-Path -Path $cliFolder -ChildPath "powershell" +Copy-Item -Path "$PSScriptRoot/codeql-extractor.yml" -Destination $powershellFolder -Force +Copy-Item -Path "$PSScriptRoot/downgrades" -Destination $powershellFolder -Recurse -Force +$qlLibFolder = Join-Path -Path "$PSScriptRoot/ql" -ChildPath "lib" +Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme") -Destination $powershellFolder -Force +Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme.stats") -Destination $powershellFolder -Force +Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force diff --git a/powershell/build-osx64.ps1 b/powershell/build-osx64.ps1 new file mode 100644 index 00000000000..55877ceef6e --- /dev/null +++ b/powershell/build-osx64.ps1 @@ -0,0 +1,18 @@ +param ( + [Parameter(Mandatory=$true)][string]$cliFolder +) + +$toolsOsx64Folder = Join-Path (Join-Path (Join-Path $cliFolder "powershell") "tools") "osx64" +dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsOsx64Folder -r osx-x64 +if ($LASTEXITCODE -ne 0) { + Write-Host "Build failed" + exit 1 +} + +$powershellFolder = Join-Path -Path $cliFolder -ChildPath "powershell" +Copy-Item -Path "$PSScriptRoot/codeql-extractor.yml" -Destination $powershellFolder -Force +Copy-Item -Path "$PSScriptRoot/downgrades" -Destination $powershellFolder -Recurse -Force +$qlLibFolder = Join-Path -Path "$PSScriptRoot/ql" -ChildPath "lib" +Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme") -Destination $powershellFolder -Force +Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme.stats") -Destination $powershellFolder -Force +Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force diff --git a/powershell/build.ps1 b/powershell/build-win64.ps1 similarity index 92% rename from powershell/build.ps1 rename to powershell/build-win64.ps1 index 4c955958faa..26268167f4b 100644 --- a/powershell/build.ps1 +++ b/powershell/build-win64.ps1 @@ -3,7 +3,7 @@ param ( ) $toolsWin64Folder = Join-Path (Join-Path (Join-Path $cliFolder "powershell") "tools") "win64" -dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsWin64Folder +dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsWin64Folder -r win-x64 if ($LASTEXITCODE -ne 0) { Write-Host "Build failed" exit 1 @@ -15,4 +15,4 @@ Copy-Item -Path "$PSScriptRoot/downgrades" -Destination $powershellFolder -Recur $qlLibFolder = Join-Path -Path "$PSScriptRoot/ql" -ChildPath "lib" Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme") -Destination $powershellFolder -Force Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme.stats") -Destination $powershellFolder -Force -Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force \ No newline at end of file +Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force