release.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: npm-bump
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. newversion:
  6. description: 'npm version {major,minor,patch}'
  7. required: true
  8. env:
  9. NODE_VERSION: 'lts/*'
  10. FORCE_COLOR: 2
  11. concurrency: # prevent concurrent releases
  12. group: npm-bump
  13. cancel-in-progress: true
  14. jobs:
  15. version_and_release:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v4
  19. with:
  20. # fetch full history so things like auto-changelog work properly
  21. fetch-depth: 0
  22. - name: Use Node.js ${{ env.NODE_VERSION }}
  23. uses: actions/setup-node@v4
  24. with:
  25. node-version: ${{ env.NODE_VERSION }}
  26. # setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
  27. registry-url: 'https://registry.npmjs.org'
  28. - run: npm i
  29. - run: git status # getting odd dirty repo errors during version debug info
  30. - run: git diff
  31. - name: npm version && npm publish
  32. uses: bcomnes/npm-bump@v2.2.1
  33. with:
  34. git_email: bcomnes@gmail.com
  35. git_username: ${{ github.actor }}
  36. newversion: ${{ github.event.inputs.newversion }}
  37. github_token: ${{ secrets.GITHUB_TOKEN }} # built in actions token. Passed tp gh-release if in use.
  38. npm_token: ${{ secrets.NPM_TOKEN }} # user set secret token generated at npm