Repository navigation
ci(release): publish @nativescript/windows-napi with the runtimes - #39
Merged
Merged
Conversation
The addon had its own tag-triggered publish (windows-napi-v*) that was never used: it needed an NPM_TOKEN secret and published prereleases without a dist-tag. It now releases from npm_release.yml with every other package, at the same version and dist-tag, via trusted publishing. - resolve-release.mjs: `napi` (also part of `all`) adds three entries: the x64 and arm64 binary packages (kind napi-binding) and the JS root (kind napi-root). --skip-arm64 also drops the arm64 binary. - npm_release.yml: napi-binding builds with `napi build --target` and copies windows.<triple>.node into its npm/<triple> package; napi-root pins its optionalDependencies to the release version. Framework-only steps are gated on kind == framework. - windows-napi.yml keeps the PR build and test; its publish job and tag trigger are removed. - package.json: repository points at NativeScript/windows (npm provenance requires it) in all three packages; prepublishOnly, which published the binary packages from the folder, is removed.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Replaces the napi-rs per-triple packages with a single @nativescript/windows-napi that carries windows.win32-x64-msvc.node and windows.win32-arm64-msvc.node. The generated loader already prefers a binary next to it, so no code changes; one publish and one trusted publisher instead of three, and cross-arch app builds get both binaries. - resolve-release.mjs: `napi` is a regular package entry; it builds every rust_target (arm64 dropped with --skip-arm64). - npm_release.yml: one "Build windows-napi" step runs `napi build --target` per triple; framework-only steps skip napi. - Removes windows-napi/npm/<triple>, optionalDependencies and the `artifacts` script; package-lock.json gets the package's real name. - packages/README.md describes the new flow.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
@nativescript/windows-napihas never been published. Its tag-triggered publish job inwindows-napi.yml(windows-napi-v*) needed anNPM_TOKENsecret, and it rannpm publishwithout--tag, so a beta would have becomelatest. Beta.20 therefore went out without it.With this PR the addon releases from
npm_release.ymlalong with every other package, at the same version and dist-tag, using trusted publishing. It ships as one package that carries both binaries (windows.win32-x64-msvc.nodeandwindows.win32-arm64-msvc.node, about 1.5 MB together). The generated loader already looks for a binary next to itself first, so there are no code changes. Compared with the napi-rs per-triple packages, this means one publish and one trusted publisher, and cross-arch app builds get both binaries. Per-arch packages can be revisited later.scripts/resolve-release.mjs:napiis a regular package entry, also part ofall. Itsrust_targetsare x64 and arm64;--skip-arm64drops arm64.npm_release.yml:napi build --platform --release --target <triple>for each target and checks there's one.nodeper target.filesalready includeswindows.*.node.napi. The publish job is unchanged.windows-napi.yml: keeps the PR build and test, and drops the tag trigger and publish job.windows-napipackage files:npm/<triple>,optionalDependencies, and theartifactsandprepublishOnlyscripts.repositorynow points atNativeScript/windows, which--provenancerequires.package-lock.jsonnow has the package's real name.packages/README.md: describes the new flow.Before the next release
@nativescript/[email protected]once by hand with--tag beta. Trusted publishing can only be configured on a package that already exists.NativeScript/windows, workflownpm_release.yml, environmentnpm-publish.Testing
node scripts/resolve-release.mjswith--engine napi,--engine napi --skip-arm64, and the defaultall: matrix, tarball names, dist-tags and targets come out as expected.npm_release.ymlparses (js-yaml), andnpm cipasses inwindows-napiwith the updated lockfile..nodefiles. Installed in a clean project, it loads under Node, and the XAML suite passes 14/14 under electron.exe.