ngx-mqtt icon indicating copy to clipboard operation
ngx-mqtt copied to clipboard

Add auto npm publish action

Open AlxZchk opened this issue 4 years ago • 9 comments

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.

AlxZchk avatar Aug 19 '20 11:08 AlxZchk

@sclausen Could you review this please?

AlxZchk avatar Aug 21 '20 18:08 AlxZchk

Yes I will. I have to read up on github actions and encrypted secrets first but am currently on vacation.

sclausen avatar Aug 22 '20 01:08 sclausen

https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets

nosovk avatar Sep 02 '20 15:09 nosovk

I think it would be better, if the action just runs on pushing a tag, rather than on every commit in the master.

sclausen avatar Sep 19 '20 07:09 sclausen

@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

nosovk avatar Sep 22 '20 05:09 nosovk

@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?

nosovk avatar Sep 22 '20 05:09 nosovk

@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 avatar Sep 23 '20 18:09 nosovk

@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:

sclausen avatar Sep 23 '20 22:09 sclausen

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.

nosovk avatar Sep 24 '20 16:09 nosovk