Update version and publish npm from GH
Setting up CI with GitHub Actions to update a node.js package version from GitHub release tag and publish it to npm
Super proud of this, since it's my first node.js package ever (created brand-new account on https://www.npmjs.com/ and all 😁), for doing syntax highlighting for dotnetconfig that works in docfx.
Assuming you already have a package.json
in the root repo dir, add the .github\workflows\npm.yml
as follows:
I'm running only on release creation
Using the GitHub envvar for the checked out tag, I'm updating the version but opting out of the git behavior (which fails on CI because it's a detached head at that point)
Finally you'll need to create that secret in GH for the publish step.
PreviousHow to skip steps or jobs in GitHub Actions for PRs from forksNextPush to protected branch from GitHub actions
Last updated