Skip to content
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

Add auto npm publish action #161

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AlxZchk
Copy link

@AlxZchk AlxZchk commented Aug 19, 2020

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
Copy link
Author

AlxZchk commented Aug 21, 2020

@sclausen Could you review this please?

@sclausen
Copy link
Owner

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

@sclausen
Copy link
Owner

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

@nosovk
Copy link
Contributor

nosovk commented Sep 22, 2020

@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
Copy link
Contributor

nosovk commented Sep 22, 2020

@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
Copy link
Contributor

nosovk commented Sep 23, 2020

@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

@sclausen
Copy link
Owner

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

@nosovk
Copy link
Contributor

nosovk commented Sep 24, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants