Skip to content

Merge pull request #272 from DiplomacyTeam/l10n_dev #643

Merge pull request #272 from DiplomacyTeam/l10n_dev

Merge pull request #272 from DiplomacyTeam/l10n_dev #643

Workflow file for this run

name: TestBuild
on:
push:
branches-ignore:
- main
pull_request:
branches:
- main
- dev
# hopefully will be triggered more often
types: [assigned, opened, edited, reopened, review_requested, ready_for_review]
workflow_dispatch:
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
name: Test build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 6.0.x
- name: Build Diplomacy Module for testing
run: |
$path = $PWD.Path + '/bannerlord';
$implFX = $PWD.Path + '/bannerlord-implementationsFX';
$implCore = $PWD.Path + '/bannerlord-implementationsCore';
$finalFX = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/';
$finalCore = $path + '/Modules/Bannerlord.Diplomacy/bin/Gaming.Desktop.x64_Shipping_Client/';
$proj = 'src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj';
$pdllFX = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/Bannerlord.Diplomacy*.dll';
$ppdbFX = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/Bannerlord.Diplomacy*.pdb';
$pdllCore = $path + '/Modules/Bannerlord.Diplomacy/bin/Gaming.Desktop.x64_Shipping_Client/Bannerlord.Diplomacy*.dll';
$ppdbCore = $path + '/Modules/Bannerlord.Diplomacy/bin/Gaming.Desktop.x64_Shipping_Client/Bannerlord.Diplomacy*.pdb';
# The folders are required to be created before executing the script
New-Item -ItemType directory -Force -Path $path;
New-Item -ItemType directory -Force -Path $implFX;
New-Item -ItemType directory -Force -Path $implCore;
[string[]]$gameversions = Get-Content -Path supported-game-versions.txt;
# Process all implementations
For ($i = 0; $i -le $gameversions.Length - 1; $i++)
{
$gameversion = $gameversions[$i];
$version = $gameversion.substring(1);
$constgameversion = $gameversion.replace(".", "");
echo "::group::Build for $gameversion"
echo "Start building for gameversion = $gameversion"
dotnet clean $proj --configuration Release;
dotnet build $proj --configuration Release -p:OverrideGameVersion=$gameversion -p:GameFolder="$path" -p:ConstGameVersionWithPrefix="$constgameversion";
# Copy Implementations to the Implementations folder
Copy-Item $pdllFX $implFX/;
Copy-Item $ppdbFX $implFX/;
Copy-Item $pdllCore $implCore/;
Copy-Item $ppdbCore $implCore/;
echo "::endgroup::"
}
# Copy Implementations to the Module
Copy-Item $implFX/* $finalFX;
Copy-Item $implCore/* $finalCore;
# Delete Implementations folder
Remove-Item -Recurse $implFX;
Remove-Item -Recurse $implCore;
shell: pwsh