-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (42 loc) · 1.19 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
name: Publish To NPM
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
yarn
- name: Run Tests
run: |
yarn test
- name: Build
run: |
yarn build
- name: Copy files
run: |
cp package.json dist/package.json
cp README.md dist/README.md
cp LICENSE dist/LICENSE
- name: Setup Package Manager
uses: actions/setup-node@master
with:
node-version: 14
registry-url: "https://registry.npmjs.org/"
- name: Install the most recent version of NPM
# This is done so the "set-script" command can be used
run: |
npm install -g npm@latest
- name: Remove "prepare" script
# This script must be removed because it uses
# a devDependency and they doesn't exist in this context
run: |
cd ./dist && npm set-script prepare "" && cd ..
- name: Publish to NPM
run: |
npm publish ./dist --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}