Builds and packages the native libnserial library used by
RJCP.SerialPortStream.
The upstream repository is pinned to release/v3.0.5 as a Git submodule, so
native builds are reproducible without copying its sources into this
repository.
The NuGet package contains native assets for these runtime identifiers:
linux-x64linux-arm64
Reference the managed and native packages together:
<ItemGroup>
<PackageReference Include="RJCP.SerialPortStream" Version="3.0.5" />
<PackageReference Include="Darp.DLL.SerialPortStream.Native" Version="3.0.5" />
</ItemGroup>The package places a native binary named libnserial.so.1 in every runtime
asset directory. That exact name is intentional: it matches the library name
used by the managed P/Invoke declarations.
Initialize the submodule and build for the current machine:
git submodule update --init --recursive
./scripts/build-native.ps1 -RuntimeId linux-x64Then pack after all desired runtime directories exist below
artifacts/native:
dotnet pack src/Darp.DLL.SerialPortStream.Native/Darp.DLL.SerialPortStream.Native.csproj `
-c Release `
-o artifacts/packagesThe GitHub Actions workflow builds on native Linux x64 and arm64 runners, aggregates both binaries into one package, and tests that package on both architectures. The linked test fixture comes directly from the pinned upstream submodule; the small local support classes only replace upstream test-project dependencies that live in separate repositories.
Push a semantic version tag to build, test, pack, and publish that version to
the rosslight GitHub Packages NuGet registry:
git tag v1.2.3
git push origin v1.2.3The tag must match vMAJOR.MINOR.PATCH. The publishing workflow removes the
leading v, passes the resulting version to the existing build workflow, and
publishes only after the package tests pass on Linux x64 and arm64. It also
uses GitHub's generated release notes to create a GitHub Release and attaches
the .nupkg.
Update the submodule deliberately and run the complete workflow:
git -C native/SerialPortStream fetch --tags
git -C native/SerialPortStream checkout <commit-or-tag>
git add native/SerialPortStreamIf upstream changes its native ABI, update NativeLibraryVersion and the build
script's expected output names together.