Skip to content

Commit 5c21ee6

Browse files
committed
(build) added - arm64 windows and macos native tar.gz
1 parent 1b52a39 commit 5c21ee6

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

build/build/BuildContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public class BuildContext : BuildContextBase
1010

1111
public readonly Dictionary<PlatformFamily, string[]> NativeRuntimes = new()
1212
{
13-
[PlatformFamily.Windows] = new[] { "win-x64", "win-x86" },
13+
[PlatformFamily.Windows] = new[] { "win-x64", "win-x86", "win-arm64" },
1414
[PlatformFamily.Linux] = new[] { "linux-x64", "linux-musl-x64", "linux-arm64", "linux-musl-arm64" },
15-
[PlatformFamily.OSX] = new[] { "osx-x64" },
15+
[PlatformFamily.OSX] = new[] { "osx-x64", "osx-arm64" },
1616
};
1717

1818
public bool EnabledUnitTests { get; set; }

build/build/Tasks/Package/PackagePrepare.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private static void PackPrepareNative(BuildContext context)
3939

4040
// testing windows and macos artifacts, the linux is tested with docker
4141
if (platform == PlatformFamily.Linux) continue;
42+
if (runtime.EndsWith("arm64")) continue;
4243

4344
context.Information("Validating native lib:");
4445
var nativeExe = outputPath.CombineWithFilePath(context.IsOnWindows ? "gitversion.exe" : "gitversion");
@@ -64,6 +65,12 @@ private static DirectoryPath PackPrepareNative(BuildContext context, string runt
6465
SelfContained = true
6566
};
6667

68+
// workaround for https://github.com/dotnet/runtime/issues/49508
69+
if (runtime == "osx-arm64")
70+
{
71+
settings.ArgumentCustomization = arg => arg.Append("/p:OsxArm64=true");
72+
}
73+
6774
context.DotNetPublish("./src/GitVersion.App/GitVersion.App.csproj", settings);
6875

6976
return outputPath;

src/GitVersion.App/GitVersion.App.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
<TargetFrameworks>net48;$(TargetFrameworks);</TargetFrameworks>
1515
</PropertyGroup>
1616

17+
<!-- workaround for https://github.com/dotnet/runtime/issues/49508 -->
18+
<PropertyGroup Condition=" '$(OsxArm64)' == 'true'">
19+
<TargetFrameworks>net6.0</TargetFrameworks>
20+
</PropertyGroup>
21+
1722
<PropertyGroup Condition=" '$(PackAsTool)' == 'true' ">
1823
<ToolCommandName>dotnet-gitversion</ToolCommandName>
1924
<PackageId>GitVersion.Tool</PackageId>

0 commit comments

Comments
 (0)