Skip to content

ci: publish a nakamir-suffixed package built against local sk_renderer - #7

Merged
austinbhale merged 5 commits into
developfrom
nakamir-package-publish
Jul 26, 2026
Merged

ci: publish a nakamir-suffixed package built against local sk_renderer#7
austinbhale merged 5 commits into
developfrom
nakamir-package-publish

Conversation

@austinbhale

Copy link
Copy Markdown
Member

Lets this fork publish the configuration Nakamir actually consumes, so the
consumer can restore StereoKit as a package instead of compiling StereoKitC from
source on every CI run.

Today the pipeline can only build vanilla StereoKit against the CPM-pinned
renderer. Nakamir builds against sk_renderer, which CMakeLists.txt detects as
a sibling of the repo root — a path outside the Actions workspace, and so out of
reach of actions/checkout. Each native job now checks the renderer out inside
the workspace and moves it into place. Its ref is an input rather than a pin
because only the consuming repo knows which pair of revisions is valid.

Versioning

Set-Version.ps1 takes a -suffix that extends the prerelease label instead of
replacing it, following the convention already used for the forked PSI packages
(Microsoft.Psi.Audio ships as 0.19.100.7-beta.nakamir). The package ID stays
StereoKit; only the version distinguishes it.

Checked against NuGet.Versioning, ascending:

0.4.0-preview.3318
0.4.0-preview.3318.nakamir.0
0.4.0-preview.3318.nakamir.1
0.4.0-preview.3319
0.4.0

So a suffixed build sorts after the upstream build it came from, and the trailing
counter allows a re-release when only sk_renderer moved. It sorts below the
next upstream preview, so consumers must pin exactly rather than float.

The numeric SK_VERSION_* macros in stereokit.h cannot carry a suffix, and
Get-Version.ps1 reads them to compose the .nupkg filename — which would have
left dotnet nuget push looking for a file dotnet pack never produced. It now
defers to the csproj whenever that extends the header version. Both scripts are
byte-identical to before when no suffix is passed.

Publishing

Build-Nuget.ps1 takes a -source, defaulting to nuget.org, so the feed is a
caller decision. PublishRepositoryUrl is enabled because GitHub Packages
rejects a nuspec with no repository element; SourceLink was already referenced,
so its resolved URL is used rather than a hardcoded owner, keeping forks and
upstream merges correct. It also records the commit, which ties a published
package back to the revision it was built from.

Verification

  • actionlint reports nothing new; the three findings on build.yml predate this branch
  • both scripts parse, and were exercised end to end against real repo files for the suffixed and unsuffixed cases
  • SourceLink resolution confirmed by packing a probe project in this repo:
    <repository type="git" url="https://github.com/Nakamir-Code/StereoKit.git" commit="88db9e6…" />

No workflow has been dispatched yet — NUGET_KEY needs a token with
write:packages before the first publish.

The build had no way to produce the configuration Nakamir actually consumes.
sk_renderer is auto-detected as a sibling of the repo root, which sits outside
the workspace, so CI checks it out inside and moves it into place. Its ref is an
input because only the consuming repo knows which pair of revisions is valid.

Set-Version gains a suffix that extends the prerelease label instead of
replacing it, keeping the result ordered after the upstream build it came from.
The header macros are numeric and cannot carry it, so Get-Version now defers to
the csproj whenever it extends the header version, which keeps the .nupkg path
in step with what dotnet pack emits. Both stay byte-identical without a suffix.

The push target is now a parameter so the feed is a caller decision.
GitHub Packages rejects a push whose nuspec carries no repository element.
SourceLink is already referenced, so publishing its resolved URL fills that in
without hardcoding an owner, which keeps forks and upstream merges correct. It
also records the commit, tying a published package to the revision it came from.
The three native jobs never pack, so passing -suffix to their Set-Version
calls had no effect. The workflow_call copies of suffix and skRendererRef
are never supplied by nightly_build or release_build; nugetSource stays
declared there so its upload target does not resolve to an empty string.
Publishing to a GitHub Packages feed in the workflow's own org needs no
PAT. Callers that set NUGET_KEY, such as nightly_build and release_build
pushing to nuget.org, are unaffected.
Build-Nuget re-stamps the version from the numeric components alone, which
dropped the suffix the workflow had just written and left the computed
nupkg path pointing at a file pack never produced.
@austinbhale
austinbhale merged commit 5b3b3bf into develop Jul 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant