Revise NuGet packaging (#221)

This commit is contained in:
Ruben Buniatyan 2023-03-17 16:59:32 +01:00 committed by GitHub
parent 93714c2a8c
commit 0b6791bbce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 33 deletions

View File

@ -87,14 +87,14 @@ jobs:
name: ckzg-library-wrapper-linux-arm64 name: ckzg-library-wrapper-linux-arm64
path: bindings/csharp/Ckzg.Bindings/runtimes/linux-arm64/native path: bindings/csharp/Ckzg.Bindings/runtimes/linux-arm64/native
- name: Setup .NET Core SDK - name: Set up .NET
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
- name: Install dependencies - name: Install dependencies
run: cd bindings/csharp && dotnet restore run: cd bindings/csharp && dotnet restore
- name: Test - name: Test
run: cd bindings/csharp && dotnet test --configuration Release --no-restore run: cd bindings/csharp && dotnet test -c release --no-restore
- name: Build - name: Build
run: cd bindings/csharp && dotnet pack -p:Version=${{ inputs.version || env.binding_build_number_based_version }} --configuration Release --no-restore --output nupkgs run: cd bindings/csharp && dotnet pack -c release --no-restore -o nupkgs -p:Version=${{ inputs.version || env.binding_build_number_based_version }} -p:ContinuousIntegrationBuild=true
- name: Upload package - name: Upload package
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -102,4 +102,4 @@ jobs:
path: bindings/csharp/nupkgs/Ckzg.Bindings.*.nupkg path: bindings/csharp/nupkgs/Ckzg.Bindings.*.nupkg
- name: Publish package - name: Publish package
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
run: dotnet nuget push bindings/csharp/nupkgs/Ckzg.Bindings.*.nupkg --api-key ${{ secrets.CSHARP_NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json run: dotnet nuget push bindings/csharp/nupkgs/*.nupkg -k ${{ secrets.CSHARP_NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json

View File

@ -1,35 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild> <ImplicitUsings>enable</ImplicitUsings>
<ImplicitUsings>enable</ImplicitUsings> <LangVersion>latest</LangVersion>
<LangVersion>preview</LangVersion> <Nullable>enable</Nullable>
<Nullable>enable</Nullable> <OutputType>Library</OutputType>
<OutputType>Library</OutputType> <RootNamespace>Ckzg</RootNamespace>
<PackageLicenseFile>LICENSE</PackageLicenseFile> <TargetFramework>net6.0</TargetFramework>
<PackageProjectUrl>https://github.com/ethereum/c-kzg-4844/tree/main/bindings/csharp</PackageProjectUrl> </PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>c-kzg eip-4844</PackageTags>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/ethereum/c-kzg-4844</RepositoryUrl>
<RootNamespace>Ckzg</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<Title>Ckzg.Bindings</Title>
<Version>0.1.0.0</Version>
</PropertyGroup>
<ItemGroup> <PropertyGroup>
<None Include="..\README.md" Pack="true" PackagePath="\"/> <Authors>Ethereum Foundation</Authors>
<None Include="..\..\..\LICENSE" Pack="true" PackagePath="\"/> <Copyright>Ethereum Foundation</Copyright>
</ItemGroup> <Description>The C# bindings for the Polynomial Commitments API library for EIP-4844</Description>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<PackageId>Ckzg.Bindings</PackageId>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>c-kzg eip-4844</PackageTags>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/ethereum/c-kzg-4844</RepositoryUrl>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Version>0.1.0.0</Version>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/win-x64/native/ckzg.dll')" Include="runtimes/win-x64/native/ckzg.dll" Pack="true" PackagePath="runtimes/win-x64/native/ckzg.dll"/> <None Include="..\README.md" Pack="true" PackagePath="\" />
<Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/linux-x64/native/ckzg.so')" Include="runtimes/linux-x64/native/ckzg.so" Pack="true" PackagePath="runtimes/linux-x64/native/ckzg.so"/> </ItemGroup>
<Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/linux-arm64/native/ckzg.so')" Include="runtimes/linux-arm64/native/ckzg.so" Pack="true" PackagePath="runtimes/linux-arm64/native/ckzg.so"/>
<Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/osx-x64/native/ckzg.so')" Include="runtimes/osx-x64/native/ckzg.so" Pack="true" PackagePath="runtimes/osx-x64/native/ckzg.so"/> <ItemGroup>
<Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/osx-arm64/native/ckzg.so')" Include="runtimes/osx-arm64/native/ckzg.so" Pack="true" PackagePath="runtimes/osx-arm64/native/ckzg.so"/> <Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/win-x64/native/ckzg.dll')" Include="runtimes/win-x64/native/ckzg.dll" Pack="true" PackagePath="runtimes/win-x64/native/ckzg.dll" />
</ItemGroup> <Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/linux-x64/native/ckzg.so')" Include="runtimes/linux-x64/native/ckzg.so" Pack="true" PackagePath="runtimes/linux-x64/native/ckzg.so" />
<Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/linux-arm64/native/ckzg.so')" Include="runtimes/linux-arm64/native/ckzg.so" Pack="true" PackagePath="runtimes/linux-arm64/native/ckzg.so" />
<Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/osx-x64/native/ckzg.so')" Include="runtimes/osx-x64/native/ckzg.so" Pack="true" PackagePath="runtimes/osx-x64/native/ckzg.so" />
<Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/osx-arm64/native/ckzg.so')" Include="runtimes/osx-arm64/native/ckzg.so" Pack="true" PackagePath="runtimes/osx-arm64/native/ckzg.so" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project> </Project>