-
Notifications
You must be signed in to change notification settings - Fork 101
Prepare release-ready C# NuGet package workflow #1707
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
Open
chavic
wants to merge
12
commits into
payjoin:master
Choose a base branch
from
chavic:chavic/csharp-nuget-release-readiness-1448
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
98c2219
Prepare C# NuGet package workflow
chavic c26d886
Document C# NuGet release workflow
chavic d242b40
csharp: Signal production bindings without an empty env var
chavic 1992835
csharp: Skip binding generation in per-RID native builds
chavic b4559ed
csharp: Document the explicit production bindings flow
chavic 0db5be8
csharp: Scope package analysis suppression to NU5131
chavic d6bfaa2
csharp: Derive the smoke test version from the packed artifact
chavic ad25faf
csharp: Cross-compile all native assets from Linux
chavic 6252ef2
csharp: Pin the cross build job to the exact toolchain version
chavic 40a53bd
csharp: Satisfy shellcheck in the cross build dispatch
chavic 64099f3
csharp: Provide the MSVC tool frontends for xwin cross builds
chavic bb5eb7f
csharp: Pin the cross toolchain and the pack toolchain exactly
chavic 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
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 |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ src/*.cs | |
| # Build outputs | ||
| bin/ | ||
| obj/ | ||
| artifacts/ | ||
|
|
||
| # IDE | ||
| .vs/ | ||
|
|
||
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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <Project> | ||
| <PropertyGroup> | ||
| <BaseIntermediateOutputPath>obj/$(MSBuildProjectName)/</BaseIntermediateOutputPath> | ||
| <BaseOutputPath>bin/$(MSBuildProjectName)/</BaseOutputPath> | ||
| <DefaultItemExcludes>$(DefaultItemExcludes);obj/**;bin/**;artifacts/**</DefaultItemExcludes> | ||
| </PropertyGroup> | ||
| </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
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
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 |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
| <IsPackable>true</IsPackable> | ||
| <PackageId>Payjoin</PackageId> | ||
| <Version>0.24.0-preview.1</Version> | ||
|
Collaborator
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.
Collaborator
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. Okay, will match those here too |
||
| <Title>Payjoin</Title> | ||
| <Authors>Payjoin Dev Kit Contributors</Authors> | ||
| <Description>C# bindings for payjoin-ffi, generated from rust-payjoin via UniFFI.</Description> | ||
| <PackageTags>bitcoin;payjoin;bip78;ffi;csharp;dotnet</PackageTags> | ||
| <PackageProjectUrl>https://github.com/payjoin/rust-payjoin</PackageProjectUrl> | ||
| <RepositoryUrl>https://github.com/payjoin/rust-payjoin</RepositoryUrl> | ||
| <RepositoryType>git</RepositoryType> | ||
| <PackageLicenseExpression>MIT OR Apache-2.0</PackageLicenseExpression> | ||
| <PackageReadmeFile>README.md</PackageReadmeFile> | ||
| <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> | ||
| <IncludeBuildOutput>false</IncludeBuildOutput> | ||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | ||
| <!-- Accepted warnings from UniFFI-generated code: CS0108 (generated exception | ||
| Message types hide Exception.Message) and CS0659 (generated classes override | ||
| Equals without GetHashCode). Regenerate rather than hand-edit src/payjoin.cs. | ||
| NU5131 fires because the package ships a ref/net10.0 assembly (the intentional | ||
| native-asset layout: compile against ref/, run from runtimes/) and csproj-based | ||
| pack cannot emit the nuspec references group the analysis asks for; consumption | ||
| is covered by the per-RID smoke tests. Keep every other package-analysis warning | ||
| visible. --> | ||
| <NoWarn>$(NoWarn);CS0108;CS0659;NU5131</NoWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="src/**/*.cs" /> | ||
| <Compile Include="Payjoin.Http.cs" /> | ||
| <None Include="README.md" Pack="true" PackagePath="/" /> | ||
| <None Include="$(TargetPath)" Pack="true" PackagePath="ref/$(TargetFramework)/" /> | ||
| <None Include="$(TargetPath)" Pack="true" PackagePath="runtimes/any/lib/$(TargetFramework)/" /> | ||
| <None Include="artifacts/runtimes/linux-arm64/native/*" Pack="true" PackagePath="runtimes/linux-arm64/native/" /> | ||
| <None Include="artifacts/runtimes/linux-x64/native/*" Pack="true" PackagePath="runtimes/linux-x64/native/" /> | ||
| <None Include="artifacts/runtimes/osx-arm64/native/*" Pack="true" PackagePath="runtimes/osx-arm64/native/" /> | ||
| <None Include="artifacts/runtimes/osx-x64/native/*" Pack="true" PackagePath="runtimes/osx-x64/native/" /> | ||
| <None Include="artifacts/runtimes/win-arm64/native/*" Pack="true" PackagePath="runtimes/win-arm64/native/" /> | ||
| <None Include="artifacts/runtimes/win-x64/native/*" Pack="true" PackagePath="runtimes/win-x64/native/" /> | ||
| </ItemGroup> | ||
|
|
||
| <Target Name="ValidatePayjoinNativeAssets" BeforeTargets="Pack"> | ||
| <ItemGroup> | ||
| <PayjoinNativeAsset Include="artifacts/runtimes/**/native/*" /> | ||
| </ItemGroup> | ||
| <Error | ||
| Condition="'@(PayjoinNativeAsset)' == ''" | ||
| Text="No RID-specific native assets found. Run scripts/build_nuget_native.sh or scripts/build_nuget_native.ps1 before packing." /> | ||
| <!-- BitcoindEnv is exported by payjoin-ffi's test_utils module, which only | ||
| exists under the _test-utils feature, so its presence in the generated | ||
| bindings means they were not generated for production. --> | ||
| <Error | ||
| Condition="Exists('src/payjoin.cs') and $([System.IO.File]::ReadAllText('src/payjoin.cs').Contains('BitcoindEnv'))" | ||
| Text="Generated bindings include _test-utils. Regenerate production bindings before packing (bash: PAYJOIN_FFI_FEATURES= ./scripts/generate_bindings.sh; PowerShell: ./scripts/generate_bindings.ps1 -ProductionBindings)." /> | ||
| </Target> | ||
|
|
||
| </Project> | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
This, pack-nuget, and maybe smoke-nuget seem tightly coupled and I don't see a clear advantage of having them be independent jobs. Could they be consolidated such that:
for rid in linux-arm64 linux-x64 osx-arm64 osx-x64 win-arm64 win-x64; dothat seems prone to error.I also wonder if we could simplify the logic and not rely so much on github runners by using a cross-compiler like https://github.com/cross-rs/cross
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.
I think this is particularly done in the recent commits. Now that cross-compile is done, can start thinking about consolidation