-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (29 loc) · 901 Bytes
/
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
36
name: Publish Package
on:
push:
branches:
- main # Triggers on pushes to the main branch
#tags:
# - 'v*.*.*' # Triggers on tag pushes matching the pattern
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out the repository code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Ensure this matches your Node.js version
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
# If you have a build step, include it; otherwise, you can remove this step
# - name: Build the package
# run: npm run build
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}