-
Notifications
You must be signed in to change notification settings - Fork 153
Fix NuGet packaging #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix NuGet packaging #529
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,7 @@ jobs: | |
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ckzg-library-wrapper-${{ matrix.target.location }}-${{ matrix.target.arch || 'default' }} | ||
| name: ckzg-library-wrapper-${{ matrix.target.location }} | ||
| path: bindings/csharp/Ckzg.Bindings/runtimes/${{ matrix.target.location }}/native | ||
|
|
||
| test-ckzg-dotnet: | ||
|
|
@@ -68,7 +68,7 @@ jobs: | |
| strategy: | ||
| matrix: | ||
| target: | ||
| - host: ubuntu-22.04 | ||
| - host: ubuntu-latest | ||
| location: linux-x64 | ||
| - host: macos-latest | ||
| location: osx-arm64 | ||
|
|
@@ -84,9 +84,16 @@ jobs: | |
| run: cd bindings/csharp && dotnet restore | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: 'ckzg-library-wrapper-${{ matrix.target.location }}-*' | ||
| path: bindings/csharp/Ckzg.Bindings/runtimes/${{ matrix.target.location }}/native | ||
| merge-multiple: true | ||
| pattern: ckzg-library-wrapper-* | ||
| path: bindings/csharp/Ckzg.Bindings/runtimes | ||
| - name: Move artifacts | ||
| working-directory: bindings/csharp/Ckzg.Bindings/runtimes | ||
| run: | | ||
| mv ckzg-library-wrapper-linux-arm64/ckzg.so linux-arm64/native/ckzg.so | ||
| mv ckzg-library-wrapper-linux-x64/ckzg.so linux-x64/native/ckzg.so | ||
| mv ckzg-library-wrapper-osx-arm64/ckzg.dylib osx-arm64/native/ckzg.dylib | ||
| mv ckzg-library-wrapper-osx-x64/ckzg.dylib osx-x64/native/ckzg.dylib | ||
| mv ckzg-library-wrapper-win-x64/ckzg.dll win-x64/native/ckzg.dll | ||
| - name: Test | ||
| run: dotnet test -c release bindings/csharp/Ckzg.sln | ||
|
|
||
|
|
@@ -99,34 +106,25 @@ jobs: | |
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: ckzg-library-wrapper-* | ||
| path: bindings/csharp/Ckzg.Bindings/runtimes/linux-x64/native | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: ckzg-library-wrapper-* | ||
| path: bindings/csharp/Ckzg.Bindings/runtimes/osx-x64/native | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: ckzg-library-wrapper-* | ||
| path: bindings/csharp/Ckzg.Bindings/runtimes/win-x64/native | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: ckzg-library-wrapper-* | ||
| path: bindings/csharp/Ckzg.Bindings/runtimes/osx-arm64/native | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: ckzg-library-wrapper-* | ||
| path: bindings/csharp/Ckzg.Bindings/runtimes/linux-arm64/native | ||
|
Comment on lines
106
to
-118
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These actions were downloading all 5 artifacts 5 times for no reason. Now, it does once and later puts each of them where they should be. |
||
| path: bindings/csharp/Ckzg.Bindings/runtimes | ||
| - name: Move artifacts | ||
| working-directory: bindings/csharp/Ckzg.Bindings/runtimes | ||
| run: | | ||
| mv -f ckzg-library-wrapper-linux-arm64/ckzg.so linux-arm64/native/ckzg.so | ||
| mv -f ckzg-library-wrapper-linux-x64/ckzg.so linux-x64/native/ckzg.so | ||
| mv -f ckzg-library-wrapper-osx-arm64/ckzg.dylib osx-arm64/native/ckzg.dylib | ||
| mv -f ckzg-library-wrapper-osx-x64/ckzg.dylib osx-x64/native/ckzg.dylib | ||
| mv -f ckzg-library-wrapper-win-x64/ckzg.dll win-x64/native/ckzg.dll | ||
| - name: Set up .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| - name: Install dependencies | ||
| run: cd bindings/csharp && dotnet restore | ||
| - name: Build | ||
| 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: Pack | ||
| working-directory: bindings/csharp | ||
| run: dotnet pack -c release -o nupkgs -p:Version=${{ inputs.version || env.binding_build_number_based_version }} -p:ContinuousIntegrationBuild=true | ||
| - name: Upload package | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Ckzg.Bindings-${{ inputs.version || env.binding_build_number_based_version }} | ||
| path: bindings/csharp/nupkgs/Ckzg.Bindings.*.nupkg | ||
| - name: Publish .NET package | ||
| - name: Publish package | ||
| if: github.ref == 'refs/heads/main' | ||
| run: dotnet nuget push bindings/csharp/nupkgs/*.nupkg -k ${{ secrets.CSHARP_NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,52 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <AllowUnsafeBlocks>True</AllowUnsafeBlocks> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <LangVersion>latest</LangVersion> | ||
| <Nullable>enable</Nullable> | ||
| <OutputType>Library</OutputType> | ||
| <RootNamespace>Ckzg</RootNamespace> | ||
| <TargetFramework>net6.0</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <Authors>Ethereum Foundation</Authors> | ||
| <Copyright>Ethereum Foundation</Copyright> | ||
| <Description>The C# bindings for the Polynomial Commitments API library for EIP-4844 and EIP-7594</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 eip-7594</PackageTags> | ||
| <RepositoryType>git</RepositoryType> | ||
| <RepositoryUrl>https://github.com/ethereum/c-kzg-4844</RepositoryUrl> | ||
| <SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
| <Version>0.2.0.1</Version> | ||
| <!-- Disable the warnings about using UInt64--> | ||
| <NoWarn>$(NoWarn);IDE0049</NoWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="..\README.md" Pack="true" PackagePath="\" /> | ||
| </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" /> | ||
|
|
||
| <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.dylib')" Include="runtimes/osx-x64/native/ckzg.dylib" Pack="true" PackagePath="runtimes/osx-x64/native/ckzg.dylib" /> | ||
| <Content CopyToOutputDirectory="PreserveNewest" Condition="Exists('runtimes/osx-arm64/native/ckzg.dylib')" Include="runtimes/osx-arm64/native/ckzg.dylib" Pack="true" PackagePath="runtimes/osx-arm64/native/ckzg.dylib" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
| <PropertyGroup> | ||
| <AllowUnsafeBlocks>True</AllowUnsafeBlocks> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <LangVersion>latest</LangVersion> | ||
| <Nullable>enable</Nullable> | ||
| <OutputType>Library</OutputType> | ||
| <RootNamespace>Ckzg</RootNamespace> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <Authors>Ethereum Foundation</Authors> | ||
| <Copyright>Ethereum Foundation</Copyright> | ||
| <Description>The C# bindings for the Polynomial Commitments API library for EIP-4844 and EIP-7594</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 eip-7594</PackageTags> | ||
| <RepositoryType>git</RepositoryType> | ||
| <RepositoryUrl>https://github.com/ethereum/c-kzg-4844</RepositoryUrl> | ||
| <SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
| <Version>0.2.0.1</Version> | ||
| <!-- Disable the warnings about using UInt64--> | ||
| <NoWarn>$(NoWarn);IDE0049</NoWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="..\README.md" Pack="true" PackagePath="\" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Content CopyToOutputDirectory="PreserveNewest" Include="runtimes/win-x64/native/ckzg.dll" Pack="true" PackagePath="runtimes/win-x64/native/ckzg.dll" /> | ||
|
|
||
| <Content CopyToOutputDirectory="PreserveNewest" Include="runtimes/linux-x64/native/ckzg.so" Pack="true" PackagePath="runtimes/linux-x64/native/ckzg.so" /> | ||
| <Content CopyToOutputDirectory="PreserveNewest" Include="runtimes/linux-arm64/native/ckzg.so" Pack="true" PackagePath="runtimes/linux-arm64/native/ckzg.so" /> | ||
|
|
||
| <Content CopyToOutputDirectory="PreserveNewest" Include="runtimes/osx-x64/native/ckzg.dylib" Pack="true" PackagePath="runtimes/osx-x64/native/ckzg.dylib" /> | ||
| <Content CopyToOutputDirectory="PreserveNewest" Include="runtimes/osx-arm64/native/ckzg.dylib" Pack="true" PackagePath="runtimes/osx-arm64/native/ckzg.dylib" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the checks have been removed from the
.csprojfile, we need to ensure that each artifact is present even though it is not used on the platform being run.