Skip to content

Commit

Permalink
Merge pull request #160 from smoogipoo/net8
Browse files Browse the repository at this point in the history
Update to .NET 8
  • Loading branch information
peppy authored Feb 5, 2024
2 parents 442110a + abaa177 commit bd14fb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
- uses: actions/checkout@main
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0'
dotnet-version: '8.0.x'
- run: dotnet build osu-deploy.sln
34 changes: 6 additions & 28 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Net.Http;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
Expand Down Expand Up @@ -137,7 +136,6 @@ public static void Main(string[] args)
stopwatch.Start();

refreshDirectory(staging_folder);
updateAppveyorVersion(version);

Debug.Assert(solutionPath != null);

Expand All @@ -149,7 +147,7 @@ public static void Main(string[] args)
if (lastRelease != null)
getAssetsFromRelease(lastRelease);

runCommand("dotnet", $"publish -f net6.0 -r win-x64 {ProjectName} -o \"{stagingPath}\" --configuration Release /p:Version={version}");
runCommand("dotnet", $"publish -f net8.0 -r win-x64 {ProjectName} -o \"{stagingPath}\" --configuration Release /p:Version={version}");

// add icon to dotnet stub
runCommand("tools/rcedit-x64.exe", $"\"{stagingPath}\\osu!.exe\" --set-icon \"{iconPath}\"");
Expand Down Expand Up @@ -190,7 +188,7 @@ public static void Main(string[] args)


string nupkgFilename = $"{PackageName}.{version}.nupkg";

string installIcon = Path.Combine(Environment.CurrentDirectory, "install.ico");

runCommand(squirrelPath,
Expand Down Expand Up @@ -256,7 +254,7 @@ public static void Main(string[] args)
);

runCommand("dotnet", "publish"
+ " -f net6.0-android"
+ " -f net8.0-android"
+ " -r android-arm64"
+ " -c Release"
+ $" -o {stagingPath}"
Expand All @@ -272,7 +270,7 @@ public static void Main(string[] args)

case RuntimeInfo.Platform.iOS:
runCommand("dotnet", "publish"
+ " -f net6.0-ios"
+ " -f net8.0-ios"
+ " -r ios-arm64"
+ " -c Release"
+ $" -o {stagingPath}"
Expand Down Expand Up @@ -301,7 +299,7 @@ public static void Main(string[] args)
// mark AppRun as executable, as zip does not contains executable information
runCommand("chmod", $"+x {stagingTarget}/AppRun");

runCommand("dotnet", $"publish -f net6.0 -r linux-x64 {ProjectName} -o {stagingTarget}/usr/bin/ --configuration Release /p:Version={version} --self-contained");
runCommand("dotnet", $"publish -f net8.0 -r linux-x64 {ProjectName} -o {stagingTarget}/usr/bin/ --configuration Release /p:Version={version} --self-contained");

// mark output as executable
runCommand("chmod", $"+x {stagingTarget}/usr/bin/osu!");
Expand Down Expand Up @@ -372,7 +370,7 @@ private static void buildForMac(string arch, string version)
// without touching the app bundle itself, changes to file associations / icons / etc. will be cached at a macOS level and not updated.
runCommand("touch", $"\"{Path.Combine(stagingPath, "osu!.app")}\" {stagingPath}", false);

runCommand("dotnet", $"publish -r osx-{arch} {ProjectName} --configuration Release -o {stagingPath}/osu!.app/Contents/MacOS /p:Version={version}");
runCommand("dotnet", $"publish -f net8.0 -r osx-{arch} {ProjectName} --configuration Release -o {stagingPath}/osu!.app/Contents/MacOS /p:Version={version}");

string stagingApp = $"{stagingPath}/osu!.app";
string archLabel = arch == "x64" ? "Intel" : "Apple Silicon";
Expand Down Expand Up @@ -717,26 +715,6 @@ private static void pauseIfInteractive()
Console.WriteLine();
}

private static bool updateAppveyorVersion(string version)
{
try
{
using (PowerShell ps = PowerShell.Create())
{
ps.AddScript($"Update-AppveyorBuild -Version \"{version}\"");
ps.Invoke();
}

return true;
}
catch
{
// we don't have appveyor and don't care
}

return false;
}

private static void write(string message, ConsoleColor col = ConsoleColor.Gray)
{
if (stopwatch.ElapsedMilliseconds > 0)
Expand Down
3 changes: 1 addition & 2 deletions osu.Desktop.Deploy.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Project">
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup Label="Package References">
<PackageReference Include="Clowd.Squirrel" Version="2.10.2" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.7" />
<PackageReference Include="NuGet.CommandLine" Version="6.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down

0 comments on commit bd14fb7

Please sign in to comment.