How to publish #2087
thewh1teagle
started this conversation in
General
How to publish
#2087
Replies: 1 comment 1 reply
-
You just saved my life! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It took me a while to understand how to publish it to multiple platforms and the docs / tooling of this project needs a lot of improvement about that.
How to publish?
scoped
name eg.@twitter/hello
you need to register the scopetwitter
in npmjs.com/org/createhttps://www.npmjs.com/settings/<username>/tokens
NPM_TOKEN
to your repo secrets athttps://github.com/<username>/<repo name>/settings/secrets/actions
npm
folder in the project, and runnpm publish --access public
once (keep the versions as0.0.0
just once)yarn install
That's it.
When you push again new version, change only the main
package.json
, don't change the versions insidenpm
folder - the CI will triggerprepublishOnly
scripts which does that.Gotachas
Monorepo
If you're in a monorepo and the package in subfolder, you will need to tweak
CI.yaml
eg. adding
cache-dependency-path: <folder path of package>
to every setup of nodeeg. fixing volume mounts of
Docker
And also on top of your workflow set
Caching errors in node setup with node@20
Add
To setup-node which uses v20
You may also need to fix the last publish action to download the artifacts to the right folder:
Support
x86_64-apple-darwin
:Beta Was this translation helpful? Give feedback.
All reactions