Skip to content

Color items in bp

Color items in bp #9

name: Build - Windows - Solution
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths: ["src/**"]
push:
branches: [main]
paths: ["src/**"]
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
MAKEFLAGS: "-j 2"
jobs:
build:
runs-on: windows-2022
strategy:
matrix:
buildtype: [Debug]
triplet: [x64-windows]
steps:
- uses: actions/checkout@v4
- uses: microsoft/[email protected]
- name: Get vcpkg commit ID
id: vcpkg-step
shell: pwsh
run: |
$json = Get-Content vcpkg.json -Raw | ConvertFrom-Json
$commit = $json.'builtin-baseline'
echo "vcpkgGitCommitId=$commit" >> $env:GITHUB_OUTPUT
- name: Compute vcpkg.json hash
id: hash
shell: pwsh
run: |
$bytes = [System.Text.Encoding]::UTF8.GetBytes((Get-Content "${{ github.workspace }}\vcpkg.json" -Raw))
$sha256 = [System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes)
$hash = [BitConverter]::ToString($sha256) -replace '-', ''
"hash=$hash" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Cache vcpkg artifacts
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}\vcpkg\installed
${{ github.workspace }}\vcpkg\buildtrees
${{ github.workspace }}\vcpkg\downloads
key: vcpkg-${{ matrix.triplet }}-${{ steps.hash.outputs.hash }}
restore-keys: |
vcpkg-${{ matrix.triplet }}-
- name: Install vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ steps.vcpkg-step.outputs.vcpkgGitCommitId }}
- name: Configure and Build
uses: lukka/run-cmake@main
with:
configurePreset: windows-debug-msbuild
buildPreset: windows-debug-msbuild
- name: Prepare & upload artifacts
shell: pwsh
run: |
$out = "$env:GITHUB_WORKSPACE\artifacts"
New-Item -ItemType Directory -Force -Path $out | Out-Null
$exePath = Get-ChildItem -Recurse -Path $env:GITHUB_WORKSPACE -Filter "otclient*.exe" | Select-Object -First 1
if (-not $exePath) {
Write-Error "Not found otclient*.exe!"
exit 1
}
Copy-Item $exePath.FullName -Destination $out
$dlls = Get-ChildItem -Path $exePath.Directory.FullName -Filter "*.dll"
foreach ($dll in $dlls) {
Copy-Item $dll.FullName -Destination $out
}
- uses: actions/upload-artifact@v4
with:
name: otclient-${{ matrix.buildtype }}
path: artifacts