This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ windows-2022 ] | |
toolkit: [ 14.29, 14.39 ] | |
include: | |
- os: windows-2019 | |
toolkit: 14.29 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: TheMrMilchmann/setup-msvc-dev@v3 | |
with: | |
arch: amd64_x86 | |
toolset: ${{ matrix.toolkit }} | |
export-path-to-vcvarsall: VCVARSALL | |
- name: Setup CMake Ninja Multi-Config | |
run: cmake -G "Ninja Multi-Config" --preset x86-multi-config -S . -B out/build/x86-multi-config | |
- name: CMake Build | |
run: cmake --build out/build/x86-multi-config --target all -j 16 | |
- name: CMake Install | |
run: cmake --build out/build/x86-multi-config --target install | |
- name: Convert version to toolkit | |
id: convert-version | |
env: | |
OS: ${{ matrix.os }} | |
MSVC_VERSION: ${{ matrix.toolkit }} | |
run: | | |
$TOOLKIT="" | |
echo $env:MSVC_VERSION | |
if ($env:MSVC_VERSION -match "^14\.2[0-9]$") { $TOOLKIT="v142" } | |
if ($env:MSVC_VERSION -match "^14\.[34][0-9]$") { $TOOLKIT="v143" } | |
echo $TOOLKIT | |
echo "TOOLKIT=$TOOLKIT" >> $env:GITHUB_OUTPUT | |
echo $(git submodule status) >> out/install/x86-multi-config/submodules.ref.txt | |
$unionApiRef = git submodule status union-api | %{($_ -split "\s+")[1]} | |
$gothicApiRef = git submodule status gothic-api | %{($_ -split "\s+")[1]} | |
echo $unionApiRef >> out/install/x86-multi-config/union-api.ref.txt | |
echo $gothicApiRef >> out/install/x86-multi-config/gothic-api.ref.txt | |
$date = Get-Date -Format 'yyyy.MM.ddTHH.mm' | |
echo $date >> out/install/x86-multi-config/build-time.txt | |
$os = $env:OS | |
$filename = "UnionAPI-$TOOLKIT-$os-$date.zip" | |
echo $filename >> $env:GITHUB_OUTPUT | |
Compress-Archive out/install/x86-multi-config/* out/install/x86-multi-config/$filename | |
$hash = Get-FileHash -Path out/install/x86-multi-config/$filename -Algorithm SHA256 | |
echo $hash >> out/install/x86-multi-config/$filename.sha256 | |
- name: Archive ZIP | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.convert-version.outputs.filename }} | |
path: out/install/x86-multi-config/${{ steps.convert-version.outputs.filename }} | |
- name: Archive SHA256 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.convert-version.outputs.filename }}.sha256 | |
path: out/install/x86-multi-config/${{ steps.convert-version.outputs.filename }}.sha256 |