Add nuget publishing for plugin packaer and abstractions (#2018)

This commit is contained in:
Andrew Camilleri
2020-10-24 17:21:50 +02:00
committed by GitHub
parent fac35b46bb
commit c8dd13577e
7 changed files with 68 additions and 8 deletions

View File

@@ -2,10 +2,32 @@
<Import Project="../Build/Version.csproj" Condition="Exists('../Build/Version.csproj')" /> <Import Project="../Build/Version.csproj" Condition="Exists('../Build/Version.csproj')" />
<Import Project="../Build/Common.csproj" /> <Import Project="../Build/Common.csproj" />
<PropertyGroup>
<Company>BTCPay Server</Company>
<Copyright>Copyright © BTCPay Server 2020</Copyright>
<Description>A library for BTCPay Server plugin development</Description>
<PackageIcon>icon.png</PackageIcon>
<PackageTags>btcpay,btcpayserver</PackageTags>
<PackageProjectUrl>https://github.com/btcpayserver/btcpayserver/tree/master/BTCPayServer.Abstractions</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/btcpayserver/btcpayserver</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<NoWarn>1591;1573;1572;1584;1570;3021</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Release' ">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(Altcoins)' != 'true'"> <ItemGroup>
<Compile Remove="Altcoins\**\*.cs"></Compile> <None Include="icon.png" Pack="true" PackagePath="\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -0,0 +1,7 @@
rm "bin\release\" -Recurse -Force
dotnet pack --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg
$package=(ls .\bin\Release\*.nupkg).FullName
dotnet nuget push $package --source "https://api.nuget.org/v3/index.json"
$ver = ((ls .\bin\release\*.nupkg)[0].Name -replace '.*(\d+\.\d+\.\d+)\.nupkg','$1')
git tag -a "BTCPayServer.Abstractions/v$ver" -m "BTCPayServer.Abstractions/$ver"
git push origin "BTCPayServer.Abstractions/v$ver"

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -1,13 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>1.0.0.1</AssemblyVersion> <Version>1.0.0.0</Version>
<PackAsTool>true</PackAsTool>
<ToolCommandName>btcpay-plugin</ToolCommandName>
<Company>BTCPay Server</Company>
<Copyright>Copyright © BTCPay Server 2020</Copyright>
<Description>A dotnet tool for packaging BTCPay Server plugins</Description>
<PackageIcon>icon.png</PackageIcon>
<PackageTags>btcpay,btcpayserver</PackageTags>
<PackageProjectUrl>https://github.com/btcpayserver/btcpayserver/tree/master/BTCPayServer.PluginPacker</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/btcpayserver/btcpayserver</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<NoWarn>1591;1573;1572;1584;1570;3021</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\BTCPayServer.Abstractions\BTCPayServer.Abstractions.csproj" /> <ProjectReference Include="..\BTCPayServer.Abstractions\BTCPayServer.Abstractions.csproj" />
</ItemGroup> <None Include="icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project> </Project>

View File

@@ -12,6 +12,11 @@ namespace BTCPayServer.PluginPacker
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
if (args.Length < 3)
{
Console.WriteLine("Usage: btcpay-plugin [directory of compiled plugin] [name of plugin] [packed plugin output directory]");
return;
}
var directory = args[0]; var directory = args[0];
var name = args[1]; var name = args[1];
var outputDir = args[2]; var outputDir = args[2];

View File

@@ -0,0 +1,7 @@
rm "bin\release\" -Recurse -Force
dotnet pack --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg
$package=(ls .\bin\Release\*.nupkg).FullName
dotnet nuget push $package --source "https://api.nuget.org/v3/index.json"
$ver = ((ls .\bin\release\*.nupkg)[0].Name -replace '.*(\d+\.\d+\.\d+)\.nupkg','$1')
git tag -a "BTCPayServer.PluginPacker/v$ver" -m "BTCPayServer.PluginPacker/$ver"
git push origin "BTCPayServer.PluginPacker/v$ver"

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB