This document covers npm publishing setup and release automation for @automatalabs/react-native-transformers.
- Create the npm package:
@automatalabs/react-native-transformers
- In npm, open the package settings and add a Trusted Publisher.
- Use these values:
- Provider: GitHub Actions
- Repository owner:
VikashLoomba - Repository name:
react-native-transformers - Workflow filename:
publish.yml - Environment name: leave empty unless you later add one to the workflow
- Save the trusted publisher.
The GitHub repo lives under the personal account, while the npm package is published under the
@automatalabsnpm scope.
.github/workflows/publish.yml handles three release paths:
- Tag release: push a
v*tag to publish the version already present inpackage.json - Manual publish: run the workflow from GitHub Actions with
mode=publish - Automated Transformers.js tracking: the scheduled run, or a manual run with
mode=track-transformers, compares the pinned@huggingface/transformersversion inpackage.jsonagainst the latest npm release and, when needed:- updates the root peer dependency and
example/package.json - bumps this package's patch version
- refreshes
package-lock.jsonandexample/package-lock.json - validates the package
- commits the change, publishes to npm, and pushes a matching
v*tag
- updates the root peer dependency and
If the peer dependency is already up to date but the current package version has not been published yet, the tracking mode republishes that current version and ensures the matching git tag exists. This lets the automation recover cleanly from a failed publish after the version-bump commit was already pushed.
- Make sure
package.jsonhas the version you want to publish. - Commit your changes.
- Tag the commit with the same version prefixed by
v.
git tag v0.1.0
git push origin HEAD --tags- GitHub Actions runs
.github/workflows/publish.yml. - The workflow publishes the package with npm provenance enabled.
From the GitHub Actions UI, run Publish package and choose one of these modes:
publish: publish the current checked-in versiontrack-transformers: sync to the latest published@huggingface/transformersversion and publish a new wrapper release if needed
npm run checknpm pack --dry-run- confirm the package contents are only the files you intend to publish
- confirm
README.md,LICENSE,package.json, and exports are correct - confirm the git tag matches
package.jsonversion when doing a tag-based release