Skip to content

Commit fa8431b

Browse files
authored
Create publish-frontend.yml
1 parent 72bf308 commit fa8431b

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Package and Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
npm-tests:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [16.x, 18.x, 20.x]
14+
# See supported Node.js release schedule at
15+
# https://nodejs.org/en/about/releases/
16+
defaults:
17+
run:
18+
working-directory: chartlets.js
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
cache-dependency-path: chartlets.js/package-lock.json
28+
29+
- run: npm ci
30+
- run: npm run lint
31+
- run: npm run build
32+
- run: npm run test
33+
34+
npm-deploy:
35+
name: Publish TS-React Package to npmjs
36+
runs-on: ubuntu-latest
37+
needs: npm-tests
38+
defaults:
39+
run:
40+
working-directory: chartlets.js
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Set up Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: '18.x'
49+
registry-url: 'https://registry.npmjs.org'
50+
cache: 'npm'
51+
cache-dependency-path: chartlets.js/package-lock.json
52+
53+
- run: npm ci
54+
- run: npm run build
55+
- run: npm publish --access public
56+
env:
57+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)