From d23b77ff3239a56fd936b91eec87bcf4cbb0d842 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Fri, 13 Mar 2026 16:24:07 -0600 Subject: [PATCH] ci: guard main package publish until all platform packages are verified on npm Prevents publishing gsd-pi to npm if any @gsd-build/engine-* optional dependency is missing at the expected version. Avoids the failure mode seen in 2.10.5 where the main package shipped before platform packages were available, causing 'Cannot find module' errors on fresh installs. --- .github/workflows/build-native.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build-native.yml b/.github/workflows/build-native.yml index f8f8c0423..ff770c679 100644 --- a/.github/workflows/build-native.yml +++ b/.github/workflows/build-native.yml @@ -145,6 +145,27 @@ jobs: - name: Wait for npm registry propagation run: sleep 30 + - name: Verify platform packages are published + run: | + VERSION=$(node -p "require('./package.json').version") + echo "Verifying platform packages at version ${VERSION}..." + FAILED=0 + for platform in darwin-arm64 darwin-x64 linux-x64-gnu linux-arm64-gnu win32-x64-msvc; do + PKG="@gsd-build/engine-${platform}" + PUBLISHED=$(npm view "${PKG}@${VERSION}" version 2>/dev/null || echo "") + if [ "${PUBLISHED}" = "${VERSION}" ]; then + echo " ✓ ${PKG}@${VERSION}" + else + echo "::error::${PKG}@${VERSION} not found on npm (got: '${PUBLISHED}')" + FAILED=1 + fi + done + if [ "${FAILED}" = "1" ]; then + echo "::error::One or more platform packages are missing from npm. Aborting main package publish to prevent broken installs." + exit 1 + fi + echo "All platform packages verified." + - name: Publish main package env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}