-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
publish @derekstride/tree-sitter-sql npm package #223
Conversation
- run: npm ci | ||
- run: npm publish --access public. | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already setup this token ☑️
yes, you can't republish the same version number
I think this is a good idea! Especially because we don't have a way to control semver (there are things like conventional commit with npm plugins but they do require some discipline to use) |
node-version: 21 | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm ci | ||
- run: npm publish --access public. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also use https://github.com/JS-DevTools/npm-publish, it only publishes a new version if the package version differs fro the last one on npm. We're using it for our npm package here: https://github.com/dodona-edu/dolos/blob/main/.github/workflows/ci-cd.yml#L529
But this command is much simpler, and might do the same check anyway.
3732bee
to
fd45dc5
Compare
I've updated the PR to publish to npm on @dmfay @matthias-Q I'm all for adopting conventional commits & semantic versioning and starting to track breaking changes to the schema if both of you are on board as well. We can unofficially start now but should start ourselves & asking other contributors to follow the guidelines after this PR lands and we publish our first release. I've also added a |
fd45dc5
to
56fddbb
Compare
CONTRIBUTING.md
Outdated
|
||
## Pushing a new Version | ||
|
||
Create a new PR to bump the version number in `package.json`. Bump the major version if the commit log since the last |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conventional commits let us automate this! add commit-and-tag-version as a dev dependency, with a release
npm script to run it as described. Then any collaborator can npm run release
locally to generate the version bump commit (including a changelog) and tag it, and pushing main + tags will let the action take over
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I've added some commits to use the commit-and-tag-version package, updated the docs, and used it to generate an initial CHANGELOG.md
.
Adopt conventional commits for easier package releases
7fbdd4e
to
bc90634
Compare
Any final comment or should I ship 🚢 this PR and publish our first release! 🎉 |
I say go for it. |
fixes #195
This sets up a workflow to publish to npm when PRs are merged into main.
I have a few open questions that anyone who has experience publishing to npm can help with:
cc// @rien