ppy / osu-deploy

Deploy script for lazer
MIT License
46 stars 32 forks source link

Windows build should be packable via `dotnet pack` #125

Closed smoogipoo closed 4 weeks ago

smoogipoo commented 2 years ago

This is just to document my findings for if they're needed in the future.

The windows build currently uses nuget.exe to make the resultant package. It should use dotnet pack instead since nuget.exe is deprecated. So are some of the options in the .nuspec such as iconUrl and the net45 target for files (we don't use net45).

The following seems to work:

diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj
index a4f9e2671b..7f10246946 100644
--- a/osu.Desktop/osu.Desktop.csproj
+++ b/osu.Desktop/osu.Desktop.csproj
@@ -11,6 +11,7 @@
     <ApplicationManifest>app.manifest</ApplicationManifest>
     <Version>0.0.0</Version>
     <FileVersion>0.0.0</FileVersion>
+    <IsPackable>true</IsPackable>
   </PropertyGroup>
   <PropertyGroup>
     <StartupObject>osu.Desktop.Program</StartupObject>
diff --git a/osu.Desktop/osu.nuspec b/osu.Desktop/osu.nuspec
index db58c325bd..898110b6a8 100644
--- a/osu.Desktop/osu.nuspec
+++ b/osu.Desktop/osu.nuspec
@@ -7,17 +7,20 @@
         <authors>ppy Pty Ltd</authors>
         <owners>Dean Herbert</owners>
         <projectUrl>https://osu.ppy.sh/</projectUrl>
-        <iconUrl>https://puu.sh/tYyXZ/9a01a5d1b0.ico</iconUrl>
         <requireLicenseAcceptance>false</requireLicenseAcceptance>
         <description>A free-to-win rhythm game. Rhythm is just a *click* away!</description>
         <releaseNotes>testing</releaseNotes>
         <copyright>Copyright (c) 2022 ppy Pty Ltd</copyright>
         <language>en-AU</language>
+        <dependencies>
+            <group targetFramework=".NET6.0"/>
+        </dependencies>
     </metadata>
     <files>
-      <file src="**.exe" target="lib\net45\" exclude="**vshost**"/>
-      <file src="**.dll" target="lib\net45\"/>
-      <file src="**.config" target="lib\net45\"/>
-      <file src="**.json" target="lib\net45\"/>
+      <file src="**.exe" target="lib\net6.0\" exclude="**vshost**"/>
+      <file src="**.dll" target="lib\net6.0\"/>
+      <file src="**.config" target="lib\net6.0\"/>
+      <file src="**.json" target="lib\net6.0\"/>
     </files>
 </package>
dotnet publish -c:Release -r:win-x64 -o out
dotnet pack --no-build --no-restore -c:Release -p:NuspecFile=osu.nuspec -p:NuspecBasePath=out

However, .nuspec itself is deprecated when using dotnet pack, so these should all be moved into the .csproj (and would remove the requirement for <IsPackable>).

caesay commented 2 years ago

Just to be clear, if you're planning on sticking with Squirrel you should probably migrate to the Squirrel.exe pack command rather than the dotnet pack command.