Great article, really appreciate the effort you put into explaining the workflow clearly. I like how you broke down each step and explained the role of the NPM token. Do you think this setup would work well for a monorepo with multiple packages or would it need adjustments?
Publish your packages to NPM automatically with GitHub Actions
OctoLab
posted
3 min read
0 Comments
OctoLab
•
Hello James Dayal,
Thanks for the feedback. This guide focuses on the single-package scenario (a package at the repository root). What gets published is exactly what npm publish would pack from that directory—primarily controlled by the files field and .npmignore, plus npm’s defaults (it always includes package.json, README*, LICENSE*, CHANGELOG*, even if not listed in files).
For monorepos (multiple package.json files), there are a few patterns:
- Point the action’s
packageinput to a specific package directory or a prebuilt .tgz. - Use a matrix over changed workspaces (e.g., Changesets/Lerna/Nx/pnpm filters) and run one publish per affected package.
- Optionally use the action’s strategy (e.g., upgrade) to skip non-semver upgrades.
I’ll cover these monorepo patterns in a dedicated post.
Best regards!
Please log in to add a comment.
Please log in to comment on this post.
More Posts
chevron_left