one for automating npm publish process when a PR containing a change in version field in package.json is merged into the master branch (it's also checking if the updated version is not published in the npm registry yet)
second one is a convenience action that can be triggered manually from Github web interface – it will run the upgrade process for the package version and push commit (as long as with new tag created for the specified version) with the version bump to the master branch. This will result in triggering the first action automatically and publish new package version in the npm registry.
Requisites
These Github Actions need secrets to be added to the repo:
NPM_AUTH_TOKEN – token that will have a capability to publish packages in the @callstack namespace in the npm registry.
GH_PAT - Github Personal Access Token is needed to be able to run the second action and push commit from Github Action. After some investigation the default token that's used by the uses: actions/checkout@v2 unfortunately is resulting in the commits pushed to the master branch NOT triggering other Actions. This is intendet behaviour, more context here: https://github.community/t/push-from-action-does-not-trigger-subsequent-action/16854/6
Test plan
I've tested the actions on forked version of this repo and was able to successfully publish package in the npm.
Summary
This PR adds two Github Actions:
npm publish
process when a PR containing a change inversion
field inpackage.json
is merged into themaster
branch (it's also checking if the updated version is not published in the npm registry yet)master
branch. This will result in triggering the first action automatically and publish new package version in the npm registry.Requisites
These Github Actions need secrets to be added to the repo:
NPM_AUTH_TOKEN
– token that will have a capability to publish packages in the@callstack
namespace in the npm registry.GH_PAT
- Github Personal Access Token is needed to be able to run the second action and push commit from Github Action. After some investigation the default token that's used by theuses: actions/checkout@v2
unfortunately is resulting in the commits pushed to themaster
branch NOT triggering other Actions. This is intendet behaviour, more context here: https://github.community/t/push-from-action-does-not-trigger-subsequent-action/16854/6Test plan
I've tested the actions on forked version of this repo and was able to successfully publish package in the npm.