Closed micalevisk closed 2 years ago
I've created an automation token on npm and added it here as a repository secret, so that part should be good to go. If that is not good or github actions can't use it, then I can move it to the environment secrets section.
My current method for publishing new versions is:
npm run build
to create a freshly bundled code into /index.js
npm run test
to see if everything still worksnpm version minor
when there are new features or npm version patch
if there are only bugfixes, which will update the package.json
, create a commit and create a new tag. If I want to test out the release procedure, then I create a beta release based on this document: https://kevinkreuzer.medium.com/publishing-a-beta-or-alpha-version-to-npm-46035b630dd7git push --follow-tags
npm publish
I think the release part of github action should only run when a new tag is created. For the record, this is what I do in my other repo: https://github.com/meszaros-lajos-gyorgy/arx-level-generator/blob/master/.github/workflows/build.yml
Currently only you (I guess) can release new versions of this package.
We could use GitHub actions to automatically publish new versions to NPM registry after some event on this repo.
My proposal: publish on new releases on this repo.
An example of an workflow that publish the package on new Git Tags (that could be easily adapted): https://github.com/micalevisk/nestjs-swagger-api-http-response-decorators/blob/main/.github/workflows/publish-on-new-tag.yml
You just need to add a secret called
NPM_TOKEN
with your NPM access token into this repo.Also, to make thinks more safer, we can add another CI workflow that will be triggered on every PR that change some code. It will ran automated tests & coverage report. So we'll make sure that only good PRs are merged to the main branch.
To implement this, I need to know a bit more about how is the current workflow from changing the code til release a new version.