ngx-mqtt
ngx-mqtt copied to clipboard
Add auto npm publish action
Added a github action to auto publish library on push to the master branch. You have to add NPM_TOKEN secret to make it work. The only issue is that tests are failing so I removed them from the chain.
@sclausen Could you review this please?
Yes I will. I have to read up on github actions and encrypted secrets first but am currently on vacation.
https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
I think it would be better, if the action just runs on pushing a tag, rather than on every commit in the master.
@AlxZchk could you change it to run on tag? There is no correct way to bind to tag creation as I see, but release option is availible - https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release
@sclausen if we can automate bumping of version via actions (like https://github.com/mikeal/merge-release) probably it could be better to execute it on any merge?
@johnbizokk can you suggest some best practices to publish NPM packages? I would like to automate https://github.com/NodeArt/stylelint-config-nodeart in a same way, to get rid of manual updates of package version in package.json
@nosovk You added standard-version
and npm scripts (scripts/syncVersions.js
) to achieve this goal, or did I became subject to misunderstanding? Does it have to be triggered by commits though?
My gut feeling doesn't like to give up this freedom somehow :thinking:
We can store 0.0.0 as package version in repo, and store real version in npm during prepublish. Like go to npm, get current version, depending on commit message upgrade version, publish new version to NPM. Then there will be no need to manage version numbers manually.