Skip to content

Commit 7ee1ebf

Browse files
authored
Create publish.yml
1 parent 86bcb00 commit 7ee1ebf

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
registry-url: 'https://registry.npmjs.org/'
19+
cache: 'npm' # Adds caching for npm dependencies
20+
21+
- name: Install dependencies
22+
run: npm ci # Use npm ci for faster, more reliable builds
23+
24+
- name: Run tests
25+
run: npm test
26+
27+
- name: Publish to npm
28+
run: npm publish
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)