Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
11eb9de
ci: run the Windows leg on the fleet's Windows VM
zignd Nov 7, 2026
9cd9264
ci: re-run the Windows leg after the runner toolchain fix
zignd Nov 7, 2026
b9ceb5d
ci: re-run the Windows leg with bash on PATH
zignd Nov 7, 2026
9443b8f
ci: re-run the Windows leg after the PATH refresh
zignd Nov 7, 2026
316540b
ci: re-run the Windows leg with jq available
zignd Nov 7, 2026
cb0142a
ci: re-run the Windows leg with cmake and ninja
zignd Nov 7, 2026
fa968d8
ci: re-run the Windows leg with the toolchain on the runner PATH
zignd Nov 7, 2026
b6a0cd3
ci: re-run the Windows leg with the C++ toolchain
zignd Nov 7, 2026
bbc964b
ci: re-run the Windows leg with the ARM64 C++ tools
zignd Nov 7, 2026
ce6f35c
ci: use the v143 toolset on the self-hosted Windows VM
zignd Nov 7, 2026
6f215b2
build: let vswhere find a Build Tools-only install
zignd Nov 7, 2026
41f2bf2
build: find a Build Tools-only install when checking the native library
zignd Nov 7, 2026
130c51a
ci: re-run the Windows leg with the SDK resolver directory set
zignd Nov 7, 2026
7d9b0b7
ci: re-run the Windows leg with the dotnet install location in the re…
zignd Nov 7, 2026
577bbc0
ci: re-run the Windows leg after the server came back
zignd Nov 7, 2026
1408cb1
ci: re-run the Windows leg with the VS .NET SDK component
zignd Nov 8, 2026
d717f5b
build: skip the VSIX templates where the Visual Studio IDE SDK is absent
zignd Nov 8, 2026
e294d26
test(tools): assert the relative-path round trip, not the hosted driv…
zignd Nov 8, 2026
36e8352
ci: re-run the Windows leg with python3 available
zignd Nov 8, 2026
52e2186
ci: re-run the Windows leg with the android workload
zignd Nov 8, 2026
3e79255
ci: re-run the Windows leg after clearing the runner action cache
zignd Nov 8, 2026
497596c
ci: re-run the Windows leg with the Android SDK
zignd Nov 8, 2026
01150e2
ci: re-run the Windows leg with the Android SDK packages
zignd Nov 8, 2026
b6545ee
ci: re-run the Windows leg with the ios and maccatalyst workloads
zignd Nov 8, 2026
5f9e36d
ci: re-run after installing the Metal toolchain on the macOS runner
zignd Nov 8, 2026
4bf159b
test: clear the cached template package before installing it
zignd Nov 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ jobs:
build:
name: build-${{ matrix.platform }}
# TRACE_CI_RUNNERS picks GitHub-hosted runners (unset) or the local fleet (`self-hosted`); see
# docs/self-hosted-runners.md in Trace Arena. Under the flag only the legs the local fleet can host exist:
# there is no Windows machine, and the arm64 Linux pool is a 1.5 GB container that cannot build the native
# runtime. Hosted CI keeps all four legs.
runs-on: ${{ vars.TRACE_CI_RUNNERS == 'self-hosted' && (matrix.platform == 'macos' && fromJSON('["self-hosted","macOS","ARM64"]') || fromJSON('["self-hosted","Linux","X64","yiazmat-linux-x64-native"]')) || (matrix.platform == 'windows' && 'windows-latest' || matrix.platform == 'macos' && 'macos-latest' || matrix.platform == 'linux-arm' && 'ubuntu-24.04-arm' || 'ubuntu-latest') }}
# docs/self-hosted-runners.md in Trace Arena. Under the flag the legs the local fleet can host exist: the Windows VM on the
# Linux server, the native x64 Linux server and the macOS machine. The arm64 Linux pool is a 1.5 GB container that cannot build
# the native runtime, so that leg stays hosted-only. Hosted CI keeps all four legs.
runs-on: ${{ vars.TRACE_CI_RUNNERS == 'self-hosted' && (matrix.platform == 'windows' && fromJSON('["self-hosted","Windows","X64"]') || matrix.platform == 'macos' && fromJSON('["self-hosted","macOS","ARM64"]') || fromJSON('["self-hosted","Linux","X64","yiazmat-linux-x64-native"]')) || (matrix.platform == 'windows' && 'windows-latest' || matrix.platform == 'macos' && 'macos-latest' || matrix.platform == 'linux-arm' && 'ubuntu-24.04-arm' || 'ubuntu-latest') }}
env:
MONOGAME_WINDOWS_PLATFORM_TOOLSET: ${{ matrix.platform == 'windows' && 'v145' || '' }}
# The VSIX templates project needs the full Visual Studio IDE SDK, which the fleet's VM (Build Tools) does not have. The hosted
# legs keep building it.
MONOGAME_SKIP_VS_TEMPLATES: ${{ vars.TRACE_CI_RUNNERS == 'self-hosted' && matrix.platform == 'windows' && '1' || '' }}
# v145 ships with the newest Visual Studio; the fleet's Windows VM has VS 2022 Build Tools, whose toolset is v143.
MONOGAME_WINDOWS_PLATFORM_TOOLSET: ${{ matrix.platform == 'windows' && (vars.TRACE_CI_RUNNERS == 'self-hosted' && 'v143' || 'v145') || '' }}
strategy:
matrix:
platform: ${{ fromJSON(vars.TRACE_CI_RUNNERS == 'self-hosted' && '["macos","linux"]' || '["windows","macos","linux","linux-arm"]') }}
platform: ${{ fromJSON(vars.TRACE_CI_RUNNERS == 'self-hosted' && '["windows","macos","linux"]' || '["windows","macos","linux","linux-arm"]') }}
fail-fast: false
defaults:
run:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@
<PropertyGroup>
<NativePlatformToolsetArgument Condition="'$(MONOGAME_WINDOWS_PLATFORM_TOOLSET)' != ''"> /p:PlatformToolset=$(MONOGAME_WINDOWS_PLATFORM_TOOLSET)</NativePlatformToolsetArgument>
</PropertyGroup>
<Exec Command="&quot;$(MSBuildProgramFiles32)\Microsoft Visual Studio\Installer\vswhere.exe&quot; -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe" ConsoleToMSBuild="true">
<!-- -products * so a Build Tools-only machine (the fleet's Windows VM) is found: vswhere's default product filter skips it. -->
<Exec Command="&quot;$(MSBuildProgramFiles32)\Microsoft Visual Studio\Installer\vswhere.exe&quot; -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="MGMSBuild" />
</Exec>
<!-- Generate Multi-Arch Solution -->
Expand Down
5 changes: 4 additions & 1 deletion Tools/MonoGame.Tools.Tests/BuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ public void CommandLineParserTests()
Assert.AreEqual(MakePath(Directory.GetCurrentDirectory(), "obj\\Content"), args.RootedIntermediateDirectory);

args = ContentBuilderParams.Parse("build", "-s", "C:/This/Does/Not/Exist");
Assert.AreEqual(MakePath("C:/This/Does/Not/Exist"), args.SourceDirectory);
// The parser stores the directory relative to the working directory. On a different drive it cannot, and the path stays
// absolute (the hosted runners work on D:); on the same drive it relativizes (the fleet's VM works on C:). Assert the
// round trip, not the hosted image's drive layout.
Assert.AreEqual(MakePath(Path.GetRelativePath(Directory.GetCurrentDirectory(), "C:/This/Does/Not/Exist")), args.SourceDirectory);

args = ContentBuilderParams.Parse(
"build",
Expand Down
5 changes: 4 additions & 1 deletion build/BuildTemplatesTasks/BuildVSTemplatesTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ namespace BuildScripts;
[IsDependentOn(typeof(BuildDotNetTemplatesTask))]
public sealed class BuildVSTemplatesTask : FrostingTask<BuildContext>
{
public override bool ShouldRun(BuildContext context) => context.IsRunningOnWindows();
// The VSIX project needs the full Visual Studio IDE SDK (VSSDK1077: no extensions directory on a Build Tools-only machine).
// The workflow sets the variable for the self-hosted Windows VM, which has the Build Tools; the hosted legs keep building it.
public override bool ShouldRun(BuildContext context) =>
context.IsRunningOnWindows() && Environment.GetEnvironmentVariable("MONOGAME_SKIP_VS_TEMPLATES") != "1";

public override void Run(BuildContext context)
{
Expand Down
19 changes: 19 additions & 0 deletions build/TestNuGetsTasks/TestMonoGameTemplateTaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,25 @@ private void UninstallExistingTemplates(BuildContext context)

private void InstallTemplates(BuildContext context, string templateVersion, string nugetSourcePath)
{
// `dotnet new uninstall` removes the template but leaves its package in ~/.templateengine/packages, and the next
// `dotnet new install` of the same version fails with "File ... already exists" (templating exit code 106) instead of
// reinstalling. Clear the cached package so a rerun on the same machine starts from a clean template store.
var templateCache = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".templateengine", "packages");
if (Directory.Exists(templateCache))
{
foreach (var cached in Directory.GetFiles(templateCache, "MonoGame.Templates.CSharp.*.nupkg"))
{
try
{
File.Delete(cached);
}
catch (IOException)
{
// A package held open by another dotnet process: the install below will report it if it matters.
}
}
}

context.Information($"Installing MonoGame templates version {templateVersion}...");
context.StartProcess("dotnet", new ProcessSettings
{
Expand Down
3 changes: 2 additions & 1 deletion build/Utils/StaticLibCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public static class StaticLibCheck
public static void CheckWindows(BuildContext context, string filePath)
{
var vswhere = new VSWhereLatest(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
var devcmdPath = vswhere.Latest(new VSWhereLatestSettings()).FullPath + @"\Common7\Tools\vsdevcmd.bat";
// Products = "*" so a Build Tools-only machine (the fleet's Windows VM) is found: the default product filter skips it.
var devcmdPath = vswhere.Latest(new VSWhereLatestSettings { Products = "*" }).FullPath + @"\Common7\Tools\vsdevcmd.bat";

context.StartProcess(
devcmdPath,
Expand Down