Skip to content

Commit 4d5cb8a

Browse files
author
Nicolas Kraiouchkine
authored
Merge pull request #25 from kraiouchkine/multi-platform-bundles
Add support for multi-platform bundle generation and additional files/certs
2 parents baf8c6a + 0fc5ed3 commit 4d5cb8a

34 files changed

+272
-415
lines changed

.github/actions/install-qlt-local/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ runs:
6060
pip install -U pyinstaller
6161
6262
# run the packaging
63-
./scripts/build_codeql_bundle_dist.ps1 -Version 0.2.0 -WorkDirectory dist -DestinationDirectory ./src/CodeQLToolkit.Core/bin/Release/net6.0/publish/linux-x64/tools/
63+
./scripts/build_codeql_bundle_dist.ps1 -Version 0.3.0 -WorkDirectory dist -DestinationDirectory ./src/CodeQLToolkit.Core/bin/Release/net6.0/publish/linux-x64/tools/
6464
env:
6565
GH_TOKEN: ${{ github.token }}
6666

.github/workflows/internal-build-release-linux64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
pip install -U pyinstaller
5151
5252
# run the packaging
53-
./scripts/build_codeql_bundle_dist.ps1 -Version 0.2.0 -WorkDirectory dist -DestinationDirectory ./src/CodeQLToolkit.Core/bin/Release/net6.0/publish/linux-x64/tools/
53+
./scripts/build_codeql_bundle_dist.ps1 -Version 0.3.0 -WorkDirectory dist -DestinationDirectory ./src/CodeQLToolkit.Core/bin/Release/net6.0/publish/linux-x64/tools/
5454
env:
5555
GH_TOKEN: ${{ github.token }}
5656

.github/workflows/internal-build-release-macos64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
pip install -U pyinstaller
4949
5050
# run the packaging
51-
./scripts/build_codeql_bundle_dist.ps1 -Version 0.2.0 -WorkDirectory dist -DestinationDirectory ./src/CodeQLToolkit.Core/bin/Release/net6.0/publish/macos-arm64/tools/
51+
./scripts/build_codeql_bundle_dist.ps1 -Version 0.3.0 -WorkDirectory dist -DestinationDirectory ./src/CodeQLToolkit.Core/bin/Release/net6.0/publish/macos-arm64/tools/
5252
env:
5353
GH_TOKEN: ${{ github.token }}
5454

.github/workflows/internal-build-release-win64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
pip install -U pyinstaller
4646
4747
# run the packaging
48-
.\scripts\build_codeql_bundle_dist.ps1 -Version 0.2.0 -WorkDirectory dist -DestinationDirectory .\src\CodeQLToolkit.Core\bin\Release\net6.0\publish\windows-x64\tools\
48+
.\scripts\build_codeql_bundle_dist.ps1 -Version 0.3.0 -WorkDirectory dist -DestinationDirectory .\src\CodeQLToolkit.Core\bin\Release\net6.0\publish\windows-x64\tools\
4949
env:
5050
GH_TOKEN: ${{ github.token }}
5151

.github/workflows/internal-pr-bundle-integration-test-cpp.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,16 @@ jobs:
9292
${{ steps.analysis.outputs.sarif-output }}/*.sarif
9393
if-no-files-found: error
9494

95-
- name: Upload Bundle Used
95+
- name: Upload Bundles
9696
uses: actions/upload-artifact@v2
9797
with:
98-
name: codeql-bundle.tar.gz
98+
name: codeql-bundles
9999
path: |
100-
${{ env.QLT_CODEQL_BUNDLE_PATH }}
100+
${{ env.QLT_CODEQL_BUNDLE_PATH_LINUX64 }}
101+
${{ env.QLT_CODEQL_BUNDLE_PATH_WIN64 }}
102+
${{ env.QLT_CODEQL_BUNDLE_PATH_OSX64 }}
101103
if-no-files-found: error
104+
compression-level: 0
102105

103106
- name: Validate SARIF Results
104107
shell: bash

.github/workflows/run-bundle-integration-tests-cpp.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
fi
5353
5454
# ensure bundle runs
55-
5655
if ! qlt query run install-packs --use-bundle --base example/ ; then
5756
echo "Failed to install query packs with tool."
5857
exit 1
@@ -65,13 +64,16 @@ jobs:
6564
echo "Checking Bundle Existence"
6665
ls -l ${{ env.QLT_CODEQL_HOME }}/../out/
6766
68-
- name: Upload Bundle Used
67+
- name: Upload Bundles
6968
uses: actions/upload-artifact@v2
7069
with:
71-
name: codeql-bundle.tar.gz
70+
name: codeql-bundles
7271
path: |
73-
${{ env.QLT_CODEQL_BUNDLE_PATH }}
72+
${{ env.QLT_CODEQL_BUNDLE_PATH_LINUX64 }}
73+
${{ env.QLT_CODEQL_BUNDLE_PATH_WIN64 }}
74+
${{ env.QLT_CODEQL_BUNDLE_PATH_OSX64 }}
7475
if-no-files-found: error
76+
compression-level: 0
7577

7678
- name: Initialize CodeQL
7779
uses: github/codeql-action/init@v2

developer_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Note that we keep recent copies of tools (for local debugging purposes) in the `
1515
**CodeQL Bundle**
1616

1717
```
18-
./scripts/build_codeql_bundle_dist.ps1 -Version 0.2.0 -WorkDirectory dist -DestinationDirectory ./src/CodeQLToolkit.Core/bin/Debug/net6.0/tools
18+
./scripts/build_codeql_bundle_dist.ps1 -Version 0.3.0 -WorkDirectory dist -DestinationDirectory ./src/CodeQLToolkit.Core/bin/Debug/net6.0/tools
1919
```
2020

2121

scripts/build_codeql_bundle_dist.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
param(
2-
[Parameter(Mandatory=$true)]
2+
[Parameter(Mandatory = $true)]
33
[string]
44
$Version,
5-
[Parameter(Mandatory=$true)]
5+
[Parameter(Mandatory = $true)]
66
[string]
77
$WorkDirectory,
88

9-
[Parameter(Mandatory=$true)]
9+
[Parameter(Mandatory = $true)]
1010
[string]
1111
$DestinationDirectory
1212
)
@@ -20,7 +20,7 @@ if (-not (Test-Path $DestinationDirectory)) {
2020
}
2121

2222
# download a copy of the release from GitHub
23-
gh release download "v$Version" --repo https://github.com/jsinglet/codeql-bundle -D $WorkDirectory -A zip
23+
gh release download "v$Version" --repo https://github.com/kraiouchkine/codeql-bundle -D $WorkDirectory -A zip
2424

2525
# extract the zip file
2626
Expand-Archive -Path "$WorkDirectory\codeql-bundle-$Version.zip" -DestinationPath $WorkDirectory
@@ -45,9 +45,10 @@ pyinstaller -F -n codeql_bundle cli.py
4545
Pop-Location
4646
Pop-Location
4747

48-
if($IsWindows){
48+
if ($IsWindows) {
4949
$OutputFile = Join-Path $ArchiveDirectory "codeql_bundle" "dist" "codeql_bundle.exe"
50-
}else{
50+
}
51+
else {
5152
$OutputFile = Join-Path $ArchiveDirectory "codeql_bundle" "dist" "codeql_bundle"
5253
}
5354

src/CodeQLToolkit.Features/Bundle/BundleFeatureMain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private BundleFeatureMain()
2929
commandFeature = new BundleCommandFeature();
3030
lifecycleFeature = new BundleLifecycleFeature();
3131
}
32-
public static BundleFeatureMain Instance { get { return instance; } }
32+
public static BundleFeatureMain Instance => instance;
3333

3434
public void Register(Command parentCommand)
3535
{

src/CodeQLToolkit.Features/Bundle/Commands/BundleCommandFeature.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ namespace CodeQLToolkit.Features.Bundle.Commands
1111
{
1212
public class BundleCommandFeature : FeatureBase, IToolkitLifecycleFeature
1313
{
14-
public override LanguageType[] SupportedLangauges
15-
{
16-
get => new LanguageType[] {
14+
public override LanguageType[] SupportedLangauges => new LanguageType[] {
1715
LanguageType.C,
1816
LanguageType.CPP,
1917
LanguageType.CSHARP,
@@ -23,7 +21,6 @@ public override LanguageType[] SupportedLangauges
2321
LanguageType.RUBY,
2422
LanguageType.PYTHON
2523
};
26-
}
2724

2825
public BundleCommandFeature()
2926
{
@@ -62,7 +59,7 @@ public void Register(Command parentCommand)
6259

6360
}.Run();
6461

65-
},Globals.BasePathOption, expectedOption, actualOption);
62+
}, Globals.BasePathOption, expectedOption, actualOption);
6663
}
6764

6865
public int Run()

0 commit comments

Comments
 (0)