-
Notifications
You must be signed in to change notification settings - Fork 18
49 lines (49 loc) · 1.22 KB
/
deploy_library.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
name: gocardless/gocardless-nodejs/deploy_library
on:
push:
branches:
- master
jobs:
test_library:
runs-on: ubuntu-latest
container:
image: node:lts
steps:
- uses: actions/[email protected]
- run: npm install --save-dev jest typescript ts-jest @types/jest
- run: npm test
transpile_library:
runs-on: ubuntu-latest
container:
image: node:lts
needs:
- test_library
steps:
- uses: actions/[email protected]
- run: npm install
- run: npm install -g typescript
- run: tsc -p .
- uses: actions/[email protected]
with:
path: "dist"
publish_to_npm:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
container:
image: node:lts
needs:
- transpile_library
env:
DIST_FOLDER: "/dist/artifact"
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
path: "/dist"
- run: cp package.json $DIST_FOLDER
- run: cp README.md $DIST_FOLDER
- run: npm install
- name: Authenticate w/NPM.
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > .npmrc
- name: Publish the library.
run: npm publish $DIST_FOLDER