Skip to content

fix(release): restore create-package.sh and set the core package version - #1429

Merged
msluszniak merged 2 commits into
mainfrom
@ms/fix-npm-publish
Sep 8, 2026
Merged

fix(release): restore create-package.sh and set the core package version#1429
msluszniak merged 2 commits into
mainfrom
@ms/fix-npm-publish

Conversation

@msluszniak

Copy link
Copy Markdown
Member

Publishing from main is currently broken in two ways. Found while updating RELEASE.md (#1428).

  1. .github/workflows/npm-publish.yml runs ./scripts/create-package.sh from packages/react-native-executorch, but the rewrite scaffold (chore: scaffold rne-rewrite target branch (#1255) #1256) deleted that script. The workflow is byte-identical to the one on release/0.9, so it was never updated for the rewrite.
  2. The core package.json still says version: 0.0.0, and that is the exact field the workflow reads to decide what it publishes. Set to 0.10.0, matching the two adapter packages and nativeLibsVersion.

Three deliberate changes from the release/0.9 copy

change why
yarn prepare instead of yarn bob build files ships both lib/ and legacy/; prepare is bob build && tsc -p legacy/tsconfig.json. Bob alone leaves legacy/ out of the tarball.
version edited by pattern, not line 3 nativeLibsVersion now sits directly below version, so a positional edit is one inserted line away from rewriting the wrong field.
build.log written with the packed file list The workflow greps it to assert no node_modules were packed, but nothing ever wrote the file, so grep failed on a missing file and the check passed vacuously.

The build.log content is the tarball listing rather than the pack output on purpose: npm pack runs the prepare lifecycle, and bob logs the path of the tsc binary it falls back to, which lives under node_modules and fails the grep on a package that is perfectly clean. That false positive showed up on the first test run.

Verified by running the script

  • builds react-native-executorch-0.10.0.tgz, 1020 files
  • packed package.json says 0.10.0
  • zero node_modules entries in the tarball, and the workflow's grep now returns 0
  • lib/ 496 files, legacy/ 294 files

Not covered: the workflow itself is unchanged here, so the first real publish is still the first end-to-end exercise of the CI path.

The npm publish workflow runs `./scripts/create-package.sh` from
packages/react-native-executorch, but the rewrite scaffold (#1256) deleted that
script. The workflow itself is byte-identical to release/0.9, so it was never
updated to match. A stable publish from main calls a file that is not there.

The core package.json also still says version 0.0.0, and that is the exact
field the workflow reads to decide what it is publishing, so the run that got
past the missing script would have published 0.0.0. Set to 0.10.0, matching the
two adapter packages and nativeLibsVersion.

The restored script differs from the release/0.9 copy in three places:

- `yarn prepare`, not `yarn bob build`. The `files` list ships both lib/ and
  legacy/, and prepare is `bob build && tsc -p legacy/tsconfig.json`. Building
  with bob alone leaves legacy/ out of the tarball.
- The nightly version rewrite matches the version line by pattern instead of
  editing line 3 by number. `nativeLibsVersion` now sits directly below
  `version`, so a positional edit is one inserted line away from rewriting the
  wrong field.
- build.log is written, holding the packed file list. The workflow asserts no
  node_modules were packed by grepping that file, but nothing ever created it,
  so grep failed on a missing file and the check passed vacuously. It has to be
  the tarball listing rather than the pack output: npm pack runs the `prepare`
  lifecycle, and bob logs the path of the tsc binary it falls back to, which
  lives under node_modules and fails the grep on a clean package.

Verified by running the script: builds react-native-executorch-0.10.0.tgz,
1020 files, version 0.10.0 in the packed package.json, zero node_modules
entries, lib/ 496 files and legacy/ 294 files.
@msluszniak msluszniak self-assigned this Sep 7, 2026
@msluszniak msluszniak added the chore PRs that are chores label Sep 7, 2026
The satellite workflow has had a `dry-run` input since it moved to the shared
publish action; the core one had no way to exercise the build and pack without
publishing, which is why the missing create-package.sh went unnoticed. Add the
same switch: everything up to the publish step runs unchanged, then `npm
publish --dry-run` instead of the real one.

`--provenance` is dropped on the dry-run branch deliberately. It performs the
OIDC exchange, which is not something a rehearsal should do.

The scheduled nightly passes no inputs, so `DRY_RUN` falls back to false and
that path is unaffected.

Also bump react-native-executorch-webrtc 0.9.0 -> 0.10.0. It was the only
package still on the previous line while the core and both fetcher adapters
are at 0.10.0, and RELEASE.md lists it among the packages published each
release.
@msluszniak
msluszniak requested a review from barhanc September 7, 2026 22:00
@msluszniak
msluszniak merged commit 3af4de8 into main Sep 8, 2026
4 checks passed
@msluszniak
msluszniak deleted the @ms/fix-npm-publish branch September 8, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore PRs that are chores

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants