-
Notifications
You must be signed in to change notification settings - Fork 56
41 lines (33 loc) · 1.09 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
36
37
38
39
40
41
# This workflow will run tests using node and then publish a package to npmjs.org when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Publish package to npmjs
on:
workflow_dispatch:
release:
types: [published]
env:
REGISTRY_URL: 'https://registry.npmjs.org/'
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: ${{ env.REGISTRY_URL }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# [27/AUG/23] Adjusted from npm ci to prevent EBADPLATFORM error due to fsevents
- name: Install npm
run: npm i
- name: Publish package to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}