SolidOS / solid-ui

User Interface widgets and utilities for Solid
https://solidos.github.io/solid-ui/dist/solid-ui.js
MIT License
148 stars 41 forks source link

publish version to npm on main branch #387

Closed angelo-v closed 3 years ago

angelo-v commented 3 years ago

With this change, solid-ui will be automatically published to npm when a version is commited/merged to the main branch.

The other job, that I renamed to npm-publish-build, was already present and published everything to npm using the git slug. With this change we also publish a version without slug as latest npm package, but only when on main branch

angelo-v commented 3 years ago

Thanks for reviewing, Michiel. I hope you are not feeling annoyed by my review requests, feel free to ignore them, in case you do not have time. I just don't want to change those things with at least someone taking note of it and give the possibility to veto

latest is just the default tag that is also applied when you do npm publish manually without specifiying something. I added it explicitly to be clear about what is happening.

When I understand JS-DevTools/npm-publish@v1 correctly, it publishes a new version to npm whenever the version in the package.json changes, so it has nothing to do with git directly. But usually as we use npm version to increment the version a git tag will be created as well. If the version in package.json is untouched, the GitHub action will just do nothing, so there will be no fail.