Skip to content

Premake script updates: #44

Premake script updates:

Premake script updates: #44

name: Plugin GTA VC
on:
workflow_dispatch:
push:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_vc/**"
pull_request:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_vc/**"
jobs:
build:
name: Build
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2 # add msbuild to PATH
- name: Premake Visual Studio project
shell: cmd
run: |
set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE%
"tools\generate\Visual Studio.bat"
- name: Build
shell: cmd
run: |
rem Compile SDK and test plugin projects
echo off
set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE%
echo ::group::Build SDK
msbuild plugin.sln /property:Configuration=zDebug /property:Platform="Mixed Platforms" /target:plugin_vc /m /fileLogger1 /fileLoggerParameters1:warningsOnly;errorsOnly;logfile=output.log
powershell -Command "(gc output.log) | sort | get-unique > output.log"
powershell -Command "(gc output.log) -replace ' \d>','' -replace '.:\\a\\plugin-sdk\\plugin-sdk\\','' | Out-File -encoding ASCII output.log"
powershell -Command "foreach($line in Get-Content 'output.log') { $m = $line -match '^(.*)\((\d+),(\d+)\): (\w+) (.*) \[.*\]$'; if ($m) {$m = $Matches; echo ('::'+$m[4]+' file='+$m[1]+',line='+$m[2]+',title=SDK compilation::'+$m[5])} else {echo ('::error title=SDK compilation::' + $line)} }"
for %%R in (output.log) do if not %%~zR lss 1 (exit 1)
echo ::groupEnd::
echo ::group::Build test plugin
msbuild examples\Test\Test.sln /property:Configuration=Debug /property:Platform=GTAVC /m /fileLogger1 /fileLoggerParameters1:warningsOnly;errorsOnly;logfile=output.log
powershell -Command "(gc output.log) | sort | get-unique > output.log"
powershell -Command "(gc output.log) -replace ' \d>','' -replace '.:\\a\\plugin-sdk\\plugin-sdk\\','' | Out-File -encoding ASCII output.log"
powershell -Command "foreach($line in Get-Content 'output.log') { $m = $line -match '^(.*)\((\d+),(\d+)\): (\w+) (.*) \[.*\]$'; if ($m) {$m = $Matches; echo ('::'+$m[4]+' file='+$m[1]+',line='+$m[2]+',title=Test plugin compilation::'+$m[5])} else {echo ('::error title=Test plugin compilation::' + $line)} }"
for %%R in (output.log) do if not %%~zR lss 1 (exit 1)
echo ::groupEnd::