Skip to content

Commit 5333ab9

Browse files
authored
Update codeql.yml
1 parent c8045c3 commit 5333ab9

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

.github/workflows/codeql.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
# - https://gh.io/supported-runners-and-hardware-resources
2828
# - https://gh.io/using-larger-runners (GitHub.com only)
2929
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'windows-latest' }}
3131
permissions:
3232
# required for all workflows
3333
security-events: write
@@ -57,6 +57,37 @@ jobs:
5757
- name: Checkout repository
5858
uses: actions/checkout@v4
5959

60+
# Set up dependencies
61+
- name: Setup .NET 9.0
62+
uses: actions/setup-dotnet@v4
63+
with:
64+
dotnet-version: 9.0.x
65+
66+
- name: Clone SecretLabDependenciesBuilder
67+
run: git clone https://github.com/Jesus-QC/SecretLabDependenciesBuilder.git
68+
69+
- name: Patch ServerDownloader.cs to skip prompts
70+
run: |
71+
sed -i '/public static async Task RunAsync()/,/^\}/c\public static async Task RunAsync()\n{\n ConsoleWriter.WriteTitle();\n _beta = Environment.GetEnvironmentVariable("SL_BETA") ?? ""; \n _betaPassword = Environment.GetEnvironmentVariable("SL_BETA_PASSWORD") ?? ""; \n DirectoryInfo installationDirectory = new(Path.Combine(Environment.CurrentDirectory, "temp"));\n installationDirectory.Create();\n string filesPath = Path.Combine(installationDirectory.FullName, "files.txt");\n await File.WriteAllTextAsync(filesPath, "regex:SCPSL_Data/Managed/*");\n List<string> args = [ "-app", "996560", "-filelist", filesPath, "-dir", installationDirectory.FullName ];\n if (!string.IsNullOrEmpty(_beta)) {\n args.Add("-beta"); args.Add(_beta);\n if (!string.IsNullOrEmpty(_betaPassword)) {\n args.Add("-betapassword"); args.Add(_betaPassword);\n }\n }\n bool success = await DepotProgram.Main(args.ToArray()) == 0;\n if (!success) {\n ConsoleWriter.Write("An error occurred while downloading the files.", ConsoleColor.Red);\n return;\n }\n DirectoryInfo managedDirectory = new(Path.Combine(installationDirectory.FullName, "SCPSL_Data/Managed"));\n AssembliesPublicizer.RunPublicizer(managedDirectory);\n installationDirectory.Delete(true);\n}\n}' SecretLabDependenciesBuilder/SecretLabDependenciesBuilder/ServerDownloader.cs
72+
73+
- name: Build SecretLabDependenciesBuilder
74+
run: |
75+
dotnet publish SecretLabDependenciesBuilder/SecretLabDependenciesBuilder/SecretLabDependenciesBuilder.csproj \
76+
-c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -o builder-out
77+
chmod +x builder-out/SecretLabDependenciesBuilder
78+
79+
- name: Setup config.yml
80+
run: |
81+
cp SLDeps/config.yml config.yml
82+
83+
- name: Run SecretLabDependenciesBuilder
84+
run: |
85+
builder-out/SecretLabDependenciesBuilder
86+
87+
- name: Set dynamic variable
88+
run: echo "SL_REFERENCES=$(realpath References)" >> $GITHUB_ENV
89+
90+
6091
# Add any setup steps before running the `github/codeql-action/init` action.
6192
# This includes steps like installing compilers or runtimes (`actions/setup-node`
6293
# or others). This is typically only required for manual builds.

0 commit comments

Comments
 (0)