-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.06 KB
/
npm-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Publish to NPM
on:
push:
branches: [ "main", "publish-test" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Use Node.js (22.x)
uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci
- run: npm run bump
# Commit changes to package.json back to the repository
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: 'package.json'
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}