Skip to content

Commit

Permalink
(build) added - arm64 windows and macos native tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Nov 15, 2021
1 parent 1b52a39 commit 5c21ee6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/build/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ public class BuildContext : BuildContextBase

public readonly Dictionary<PlatformFamily, string[]> NativeRuntimes = new()
{
[PlatformFamily.Windows] = new[] { "win-x64", "win-x86" },
[PlatformFamily.Windows] = new[] { "win-x64", "win-x86", "win-arm64" },
[PlatformFamily.Linux] = new[] { "linux-x64", "linux-musl-x64", "linux-arm64", "linux-musl-arm64" },
[PlatformFamily.OSX] = new[] { "osx-x64" },
[PlatformFamily.OSX] = new[] { "osx-x64", "osx-arm64" },
};

public bool EnabledUnitTests { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions build/build/Tasks/Package/PackagePrepare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private static void PackPrepareNative(BuildContext context)

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

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

// workaround for https://github.com/dotnet/runtime/issues/49508
if (runtime == "osx-arm64")
{
settings.ArgumentCustomization = arg => arg.Append("/p:OsxArm64=true");
}

context.DotNetPublish("./src/GitVersion.App/GitVersion.App.csproj", settings);

return outputPath;
Expand Down
5 changes: 5 additions & 0 deletions src/GitVersion.App/GitVersion.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
<TargetFrameworks>net48;$(TargetFrameworks);</TargetFrameworks>
</PropertyGroup>

<!-- workaround for https://github.com/dotnet/runtime/issues/49508 -->
<PropertyGroup Condition=" '$(OsxArm64)' == 'true'">
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(PackAsTool)' == 'true' ">
<ToolCommandName>dotnet-gitversion</ToolCommandName>
<PackageId>GitVersion.Tool</PackageId>
Expand Down

0 comments on commit 5c21ee6

Please sign in to comment.