-
Notifications
You must be signed in to change notification settings - Fork 15
68 lines (62 loc) · 2.53 KB
/
TestBuild.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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/[email protected]
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 6.0.x
- name: Build Diplomacy Module for testing
run: |
$impl = $PWD.Path + '/bannerlord-implementations';
$path = $PWD.Path + '/bannerlord';
$final = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/';
$proj = 'src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj';
$pdll = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/Bannerlord.Diplomacy*.dll';
$ppdb = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/Bannerlord.Diplomacy*.pdb';
# The folders are required to be created before executing the script
New-Item -ItemType directory -Force -Path $impl;
New-Item -ItemType directory -Force -Path $path;
[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 $pdll $impl/;
Copy-Item $ppdb $impl/;
echo "::endgroup::"
}
# Copy Implementations to the Module
Copy-Item $impl/* $final;
# Delete Implementations folder
Remove-Item -Recurse $impl;
shell: pwsh