Use dotnet pack instead of nuget pack

This commit is contained in:
Kevin Zhang 2021-06-17 18:59:15 +08:00
parent 7c242c8505
commit f01962f664
3 changed files with 9 additions and 7 deletions

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
@ -12,6 +11,8 @@
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<NuspecFile>../Scripts/flowlauncher.nuspec</NuspecFile>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -100,4 +101,4 @@
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="taskkill /f /fi &quot;IMAGENAME eq Flow.Launcher.exe&quot;" />
</Target>
</Project>
</Project>

View file

@ -3,7 +3,7 @@
<metadata>
<id>FlowLauncher</id>
<title>Flow Launcher</title>
<version>$version$</version>
<version>1.0.0</version>
<authors>Flow-Launcher Team</authors>
<projectUrl>https://github.com/Flow-Launcher/Flow.Launcher</projectUrl>
<iconUrl>https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher/master/Flow.Launcher/Images/app.png</iconUrl>
@ -11,6 +11,6 @@
<description>Flow Launcher - a launcher for windows</description>
</metadata>
<files>
<file src="**\*.*" target="lib\net5.0-windows\" exclude="Flow.Launcher.vshost.exe;Flow.Launcher.vshost.exe.config;Flow.Launcher.vshost.exe.manifest;*.nupkg;Setup.exe;RELEASES"/>
<file src="**\*.*" target="lib\net5.0\" exclude="Flow.Launcher.vshost.exe;Flow.Launcher.vshost.exe.config;Flow.Launcher.vshost.exe.manifest;*.nupkg;Setup.exe;RELEASES"/>
</files>
</package>

View file

@ -71,8 +71,8 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
Write-Host "Input path: $input"
# making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced.
New-Alias Nuget $env:USERPROFILE\.nuget\packages\NuGet.CommandLine\5.4.0\tools\NuGet.exe -Force
# TODO: can we use dotnet pack here?
nuget pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release
dotnet pack "$path\Flow.Launcher\Flow.Launcher.csproj" -p:NuspecFile=$spec -p:NuspecBasePath="$path\Output\Release" -p:PackageVersion=$version -c Release --no-build --output $output
$nupkg = "$output\FlowLauncher.$version.nupkg"
Write-Host "nupkg path: $nupkg"
@ -103,7 +103,8 @@ function Publish-Self-Contained ($p) {
# we call dotnet publish on the main project.
# The other projects should have been built in Release at this point.
dotnet publish -c Release $csproj /p:PublishProfile=$profile
# dotnet publish -c Release $csproj /p:PublishProfile=$profile
}
function Main {