Skip to content

Commit e0d24a2

Browse files
authored
Refactor rid assignment based on architecture
1 parent ff7a193 commit e0d24a2

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎Tasks/PublishToolTask.cs‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ public override async Task RunAsync(BuildContext context)
1010
{
1111
var rid = "";
1212
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
13-
rid = "windows";
13+
rid = RuntimeInformation.ProcessArchitecture switch
14+
{
15+
Architecture.Arm or Architecture.Arm64 => "windows-arm64",
16+
_ => "windows-x64",
17+
};
1418
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
1519
rid = "osx";
1620
else
17-
rid = "linux";
21+
rid = RuntimeInformation.ProcessArchitecture switch
22+
{
23+
Architecture.Arm or Architecture.Arm64 => "linux-arm64",
24+
_ => "linux-x64",
25+
};
1826

1927
if (!(RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && context.IsUniversalBinary))
2028
{
@@ -41,4 +49,4 @@ public override async Task RunAsync(BuildContext context)
4149
}
4250
}
4351
}
44-
}
52+
}

0 commit comments

Comments
 (0)