|
2 | 2 |
|
3 | 3 | ## Version tag conventions |
4 | 4 |
|
5 | | -Model URLs in `packages/react-native-executorch/src/constants/modelUrls.ts` are built from two constants in `versions.ts`: |
| 5 | +Model URLs in `packages/react-native-executorch/src/models.ts` are built from |
| 6 | +`BASE_URL` plus one of two tag constants defined in the same file: |
6 | 7 |
|
7 | | -- `VERSION_TAG` — the **in-development** version (`resolve/v${LIB_VERSION}`). On `main` it points at the upcoming release; HuggingFace files under this tag may not be published until release day. |
8 | | -- `PREVIOUS_VERSION_TAG` — the **latest published stable** release. Use for back-compat references that should follow the last shipped version. |
| 8 | +- `NEXT_VERSION_TAG` — the **in-development** tag (`resolve/v${MAJOR}.${NEXT_MINOR}.0`). Models |
| 9 | + whose files are new or re-exported for the upcoming release point here. The |
| 10 | + HuggingFace files under this tag may not exist until release day. |
| 11 | +- `VERSION_TAG` — the **latest published stable** tag (`resolve/v${MAJOR}.${MINOR}.0`). Models |
| 12 | + whose files last changed in a shipped release stay here, so a release does not |
| 13 | + repoint URLs whose artifacts did not change. |
9 | 14 |
|
10 | | -Anything that must stay pinned to a specific older HuggingFace tag (e.g. deprecated aliases whose files were removed in a later release) should hardcode `resolve/v{MAJOR}.{MINOR}.0` directly in `modelUrls.ts` rather than reusing `PREVIOUS_VERSION_TAG`. |
| 15 | +Both are plain string literals; there is no `LIB_VERSION` to derive them from. |
| 16 | + |
| 17 | +> [!CAUTION] |
| 18 | +> These constants were renamed **and their meanings swapped** in v0.10. Before |
| 19 | +> that they lived in `src/constants/modelUrls.ts` / `src/constants/versions.ts`, |
| 20 | +> were derived from `LIB_VERSION`, and `VERSION_TAG` meant the *in-development* |
| 21 | +> tag while `PREVIOUS_VERSION_TAG` meant the published one. Today `VERSION_TAG` |
| 22 | +> is the **published** tag and `NEXT_VERSION_TAG` is the in-development one. |
| 23 | +> Editing `VERSION_TAG` by analogy with the old docs repoints every already |
| 24 | +> shipped model URL. |
| 25 | +
|
| 26 | +Anything that must stay pinned to a specific older HuggingFace tag (e.g. |
| 27 | +deprecated aliases whose files were removed in a later release) should hardcode |
| 28 | +`resolve/v{MAJOR}.{MINOR}.0` directly in `models.ts` rather than reusing |
| 29 | +`VERSION_TAG`. |
| 30 | + |
| 31 | +## HuggingFace artifacts |
| 32 | + |
| 33 | +The library resolves models from HuggingFace by **tag**, so publishing a `.pte` |
| 34 | +to a model repo's `main` changes nothing for users until the release tag moves |
| 35 | +to the commit holding it. Model repos are tagged independently of npm; a repo |
| 36 | +only needs a tag move if its files changed this cycle. |
| 37 | + |
| 38 | +For every model repo whose files changed: |
| 39 | + |
| 40 | +1. Confirm the new files are on `main` in the repo, and that their checksums |
| 41 | + match what was exported locally. |
| 42 | +2. Move the `v{MAJOR}.{MINOR}.0` tag to that commit (delete and recreate it). |
| 43 | +3. Read the tag back and confirm it resolves to the intended commit. |
| 44 | + |
| 45 | +Model card `README.md` files are generated from the repo tree and its |
| 46 | +`config.json` files; the standard and the generated/free section split are |
| 47 | +documented in |
| 48 | +[react-native-executorch-spec](https://huggingface.co/software-mansion/react-native-executorch-spec/blob/main/MODEL_CARD.md). |
11 | 49 |
|
12 | 50 | ## Minor version release |
13 | 51 |
|
14 | 52 | The release process of new minor version consists of the following steps: |
15 | 53 |
|
16 | | -1. On `main`, confirm every model URL in `packages/react-native-executorch/src/constants/modelUrls.ts` that should ship in this release is already pointing at `VERSION_TAG` (the in-development tag) and that the matching files exist on [🤗 huggingface](https://huggingface.co/software-mansion) under the `v{MAJOR}.{MINOR}.0` tag. |
17 | | -2. Make sure `LIB_VERSION` in `packages/react-native-executorch/src/constants/versions.ts` is `{MAJOR}.{MINOR}.0` so `VERSION_TAG` resolves to `resolve/v{MAJOR}.{MINOR}.0`. |
18 | | -3. Ensure the `version` field of `package.json` is `{MAJOR}.{MINOR}.0` for the core package (`react-native-executorch`) and both adapter packages (`bare-resource-fetcher`, `expo-resource-fetcher`). |
| 54 | +1. On `main`, confirm every model URL in `packages/react-native-executorch/src/models.ts` that should ship in this release points at `NEXT_VERSION_TAG`, and that the matching files exist on [🤗 huggingface](https://huggingface.co/software-mansion) under the `v{MAJOR}.{MINOR}.0` tag. See [HuggingFace artifacts](#huggingface-artifacts) for moving those tags. |
| 55 | +2. Make sure `NEXT_VERSION_TAG` in `packages/react-native-executorch/src/models.ts` is `resolve/v{MAJOR}.{MINOR}.0`. |
| 56 | +3. Ensure the `version` field of `package.json` is `{MAJOR}.{MINOR}.0` for all four published packages: |
| 57 | + - `packages/react-native-executorch` (core) |
| 58 | + - `packages/bare-resource-fetcher` |
| 59 | + - `packages/expo-resource-fetcher` |
| 60 | + - `packages/react-native-executorch-webrtc` |
| 61 | + |
| 62 | + The core publish workflow reads the version from |
| 63 | + `packages/react-native-executorch/package.json`, so a wrong value there is |
| 64 | + what gets published. The satellite workflow takes an explicit `version` |
| 65 | + input instead. |
| 66 | + |
| 67 | + The two fetcher adapters are still required at `{MAJOR}.{MINOR}.0`: the core |
| 68 | + package ships the pre-0.10 API as `react-native-executorch/legacy`, and that |
| 69 | + path throws at runtime unless the consumer passes an adapter from one of |
| 70 | + them. Only the new API has a built-in fetcher. |
19 | 71 | 4. If any of the above required changes, commit them on `main` with the message 'Release v{MAJOR}.{MINOR}.0'. |
20 | 72 | 5. Create a new release branch `release/{MAJOR}.{MINOR}` from `main` and push it to the remote. |
21 | | -6. Stability tests are performed on the release branch and all fixes to the new-found issues are pushed into the main branch and cherry-picked into the release branch. This allows for further development on the main branch without interfering with the release process. |
22 | | -7. Once all tests are passed, tag the release branch with proper version tag `v{MAJOR}.{MINOR}.0` and run the following publish workflows: |
| 73 | +6. Confirm the native artifacts release the package resolves at install time |
| 74 | + exists and is not a draft. `scripts/download-libs.js` downloads from the |
| 75 | + GitHub Release tagged `v${nativeLibsVersion}-libs`, with `nativeLibsVersion` |
| 76 | + pinned in the core `package.json`; if that release or any of its assets is |
| 77 | + missing, every consumer's `postinstall` fails. |
| 78 | +7. Stability tests are performed on the release branch and all fixes to the new-found issues are pushed into the main branch and cherry-picked into the release branch. This allows for further development on the main branch without interfering with the release process. |
| 79 | +8. Once all tests are passed, tag the release branch with proper version tag `v{MAJOR}.{MINOR}.0` and run the following publish workflows. Both take a `dry-run` input; a dry run builds and packs without publishing, which is worth doing first since a failed publish cannot be taken back: |
23 | 80 | - [npm publish (core)](https://github.com/software-mansion/react-native-executorch/actions/workflows/npm-publish.yml) |
24 | 81 | - [npm publish satellite packages](https://github.com/software-mansion/react-native-executorch/actions/workflows/npm-publish-satellites.yml) — run once per satellite package, selecting it via the `package` input (`react-native-executorch-bare-resource-fetcher`, `react-native-executorch-expo-resource-fetcher`, `react-native-executorch-webrtc`) |
25 | | -8. Create the release notes on GitHub. |
26 | | -9. Bump `main` to the next development cycle in a single PR: |
| 82 | +9. Create the release notes on GitHub. |
| 83 | +10. Bump `main` to the next development cycle in a single PR: |
27 | 84 | - Bump `version` in `package.json` to `{MAJOR}.{NEXT_MINOR}.0` for the core package and both adapter packages. |
28 | | - - Bump `LIB_VERSION` in `versions.ts` to `{MAJOR}.{NEXT_MINOR}.0` (this auto-bumps `VERSION_TAG`). |
29 | | - - Bump `PREVIOUS_VERSION_TAG` in `versions.ts` to `resolve/v{MAJOR}.{MINOR}.0` (the version that was just published). |
| 85 | + - In `models.ts`, set `VERSION_TAG` to `resolve/v{MAJOR}.{MINOR}.0` (the version just published) and `NEXT_VERSION_TAG` to `resolve/v{MAJOR}.{NEXT_MINOR}.0`. |
| 86 | + - Leave individual model URLs alone: those that shipped this cycle now resolve through `VERSION_TAG`, and only models re-exported next cycle move to `NEXT_VERSION_TAG`. |
30 | 87 | - Commit with the message 'Bump version to v{MAJOR}.{NEXT_MINOR}.0'. |
31 | | -10. Create versioned docs by running from repo root `(cd docs && yarn docs:version {MAJOR}.{MINOR}.x)` (the 'x' part is intentional and is not to be substituted). Also, make sure that all the links in `api-reference` are not broken. |
32 | | -11. Create a PR with the updated docs. |
33 | | -12. Update README.md with release video, if available. |
34 | | -13. Update README.md links to release branch. |
| 88 | +11. Create versioned docs by running from repo root `(cd docs && yarn docs:version {MAJOR}.{MINOR}.x)` (the 'x' part is intentional and is not to be substituted). Also, make sure that all the links in `api-reference` are not broken. |
| 89 | +12. Create a PR with the updated docs. |
| 90 | +13. Update README.md with release video, if available. |
| 91 | +14. Update README.md links to release branch. |
35 | 92 |
|
36 | 93 | ## Patch release |
37 | 94 |
|
|
0 commit comments