Fix build portability: add BepInEx NuGet feed and de-hardcode package paths

BepInEx.Core isn't on nuget.org (only on nuget.bepinex.dev), so restore
failed on machines without it configured globally. PackageThunderstore
also pointed at a contributor's personal desktop path; it now outputs
to a repo-local dist/ folder and uses the checked-in Package/icon.png.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
kanym 2026-07-31 11:24:30 +02:00
commit 95dcf3c1e6
2 changed files with 15 additions and 4 deletions

View file

@ -93,11 +93,15 @@
<CallTarget Targets="CopyToUnity" Condition="Exists('$(UNITY_FOLDER)')" />
</Target>
<Target Name="PackageThunderstore" AfterTargets="Build">
<Target Name="PackageThunderstore" AfterTargets="Build" Condition="'$(Configuration)'=='Release'">
<PropertyGroup>
<PackageOutputDir>$(SolutionDir)dist\</PackageOutputDir>
</PropertyGroup>
<MakeDir Directories="$(PackageOutputDir)" Condition="!Exists('$(PackageOutputDir)')" />
<Message Text="Packaging Thunderstore and Nexus Zips..." Importance="high" />
<Exec Command="powershell -Command &quot;if (!(Test-Path 'C:\Users\FERDINANDO\Desktop\Pacchetto_Rame\racesofvalheim')) { New-Item -ItemType Directory -Force -Path 'C:\Users\FERDINANDO\Desktop\Pacchetto_Rame\racesofvalheim' }; Compress-Archive -Path '$(TargetDir)$(TargetName).dll', '$(ProjectDir)..\manifest.json', '$(ProjectDir)..\README.md', 'C:\Users\FERDINANDO\Desktop\Pacchetto_Rame\racesofvalheim\icon.png' -DestinationPath 'C:\Users\FERDINANDO\Desktop\Pacchetto_Rame\racesofvalheim\RacesOfValheim_Thunderstore.zip' -Force; Compress-Archive -Path '$(TargetDir)$(TargetName).dll' -DestinationPath 'C:\Users\FERDINANDO\Desktop\Pacchetto_Rame\racesofvalheim\RacesOfValheim_Nexus.zip' -Force&quot;" />
<Message Text="Copying DLL to Valheim BepInEx plugins..." Importance="high" />
<Copy SourceFiles="$(TargetDir)$(TargetName).dll" DestinationFolder="C:\Program Files (x86)\Steam\steamapps\common\Valheim\BepInEx\plugins\" />
<Exec Command="powershell -NoProfile -Command &quot;Compress-Archive -Path '$(TargetDir)$(TargetName).dll', '$(ProjectDir)..\manifest.json', '$(ProjectDir)..\README.md', '$(ProjectDir)Package\icon.png' -DestinationPath '$(PackageOutputDir)RacesOfValheim_Thunderstore.zip' -Force; Compress-Archive -Path '$(TargetDir)$(TargetName).dll' -DestinationPath '$(PackageOutputDir)RacesOfValheim_Nexus.zip' -Force&quot;" />
<Message Text="Copying DLL to Valheim BepInEx plugins..." Importance="high" Condition="Exists('$(VALHEIM_INSTALL)\BepInEx\plugins')" />
<Copy SourceFiles="$(TargetDir)$(TargetName).dll" DestinationFolder="$(VALHEIM_INSTALL)\BepInEx\plugins\" Condition="Exists('$(VALHEIM_INSTALL)\BepInEx\plugins')" />
</Target>