infra[notask]: consolidate 14 on-merge-<pkg>.yml native-addon publish workflows into on-merge-nx.yml - #3829
Draft
sidj-thr wants to merge 2 commits into
Draft
infra[notask]: consolidate 14 on-merge-<pkg>.yml native-addon publish workflows into on-merge-nx.yml#3829sidj-thr wants to merge 2 commits into
sidj-thr wants to merge 2 commits into
Conversation
…ws into on-merge-nx.yml
Contributor
License compliance — findings detected (warn-only)Critical: 0 · High: 7 · Medium: 0
How to resolve a blocking finding:
Warn-only (shadow) mode — this check does not block merges yet. Updated automatically by the canonical license compliance workflow. NOTICE presence (advisory)Missing NOTICE (advisory, does not block):
|
Contributor
Workflow security (shadow mode)zizmor found 1146 finding(s) in Findings are annotated inline on the changed files and listed in the job summary. Reproduce locally: |
…ds to this exact name)
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.
🎯 What problem does this PR solve?
14 near-identical
on-merge-<pkg>.ymlnative-addon publish workflows (asr-ggml, audiogen-ggml, bci-whispercpp, classification-ggml, decoder-audio, diffusion-cpp, embed-llamacpp, fabric, llm-llamacpp, ocr-ggml, onnx, translation-nmtcpp, tts-ggml, vla-ggml) duplicate the same release-merge-guard / prebuild / GPR / npm / create-tag job graph, each 180-580 lines, with real but scattered per-package divergence (build step, name-transform, token, repo_name/tag scheme, prebuild presence, post-publish test gating).All 14 fold in — no carve-outs. Even the packages with real divergence (fabric's inline publish-logic + local npm composite, decoder-audio's total absence of prebuilds + pre-publish test gate, vla-ggml's stale slug/dir mismatch) reduce to config flags once normalized onto the shared qvac-actions and the existing nx leaves.
📝 How does it solves it?
Adds a single generic
on-merge-nx.yml.dorny/paths-filterselects the changed package(s) on push (one package per changed dir, nonx-affected— that pulls in transitive dependents, which is wrong for publish). Per-package config (build step / name-transform / token / repo_name / test-gate mode) lives in a newon-mergecarrier target on each package'sproject.json, read at runtime — safe because on-merge runs post-merge on its own ref, no fork-PR head/base split.Prebuild and pre/post-publish tests route through the existing
prebuilds-nx.yml/integration-test-nx.yml/integration-mobile-test-nx.ymlleaves via a new explicitpackagesinput onnx-project-matrix— when supplied, it bypassesnx show projects --affectedentirely and builds the matrix from exactly those packages. Default[]is a no-op for every existing caller (on-pr-nx, the 4 leaves' ownworkflow_dispatch).Release-branch identity gate (
detectstep): arelease-*branch is namedrelease-<package>-x.y.zand must publish exactly that package. Hard-fails on any mismatch — wrong package, extra package, zero packages, malformed branch name, unknown package dir — before anything builds. This closes a real gap in the existingrelease-merge-guard(kept unchanged): that guard's package-identity check is a warning only, it hard-fails on version/changelog instead, so a same-versioned sibling package with its own CHANGELOG touched in a later push on the same release branch could otherwise pass the guard and publish under someone else's release line. Verified against real release-branch history across the org repo — every package's current-convention release branches use the full package directory name (a couple of packages, e.g.vla-ggml, have older short-alias branches likerelease-vla-*, but those are strictly lower-versioned/stale; the highest-version branch for every package already uses the full dir name), so no alias-resolution layer is needed.Post-build gate (OR over GPR/npm publish result, gating post-publish tests) is a single non-matrixed job — matrix-job
outputsdon't propagate reliably to dependent jobs in GitHub Actions, only a plain job's do.Applies the same
base: ${{ github.ref_name }}fix to the already-opentrigger-reusable-lib.yml(infra[notask]: consolidate plain-shape library publish workflows #3748) and the same identity gate there — both had the same latent bug (dorny defaults to diffing against the default branch whenbaseisn't set, and the same release-branch loophole applied).Out of scope:
on-merge-model-fit.yml(not a native-addon package).🧪 How was it tested?
actionlintclean on the new workflow and every modified leaf/action (only pre-existing shellcheck style/info findings and the known composite-action false-positive syntax-check noise).detectstep's package-row compute logic run directly against all 14 realproject.jsonfiles — every row matches the intended config table exactly (build step, name-transform, token, repo_name/useVTag, test-gate mode).tmp-*branch (dornybasefix required a real push-delta to exercise correctly — verified empirically, not just by inspection):detectselected exactly one package;Prebuild (asr-ggml)compiled all platform legs for real viaprebuilds-nx.ymlwith the explicitpackagesinput;Publish GPR (asr-ggml)succeeded for real;Publish NPM (asr-ggml)was reached and correctly skipped (release-gated, not arelease-*branch) — proved npm cannot fire off a non-release branch.detectselected exactly the two changed packages, each fanned out to its own independentPrebuild/Publish GPR/Publish NPMjob set (matrix-per-package, no cross-package coupling on selection).onnx's prebuild failed on its own pre-existing vcpkg build issue (unrelated to this change —asr-ggml's prebuild, on the identical code path, succeeded cleanly); this surfaced a real finding, since fixed:publish-gprgates on the aggregateprebuildjob result across the whole matrix, so one package's prebuild failure blocks GPR publish for every package in that push, not just the failing one — same behavior as the pre-consolidation legacy files would show if they shared a job, and accepted as correct (fail-safe) rather than reworked into fully independent per-package pipelines.nx show projects --affectedagainst the diff base returns[](config/workflow-only change).🔐 Action pinning
dorny/paths-filter:fbd0ab8f3e69293af611ebaee6363fc25e6d187d # 4.0.1(repo-standard pin, already used elsewhere)tetherto/qvac-actions/npm-publish-logic,npm-dist-tag-determination,publish-library-to-npm:bbb0740e2a16b94371c7439e0e06945c5b68e759 # 0.3.0actions/checkout,actions/setup-node,actions/download-artifact: unchanged repo-standard pins carried over from the files being replaced🛡️ Permissions changes
Per-job permissions are carried over unchanged from the 14 deleted-in-spirit (not literally deleted this pass — additive) workflows; no new grant introduced.
publish-gpr—contents: read,packages: writepublish-npm—contents: write,packages: write,id-token: write(OIDC)prebuild/pre-publish-*/post-publish-*jobs — pass through whatever the called leaf (prebuilds-nx.yml,integration-test-nx.yml,integration-mobile-test-nx.yml) already declares, unchanged