forked from ghdna/athena-express
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.47 KB
/
nodejs.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
53
54
55
56
57
58
59
60
61
62
63
64
65
name: npm package pipeline
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install packages
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com
scope: '@percaysoinform'
always-auth: true
- name: cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- run: |
npm ci
npm run build --if-present
npm test
env:
NODE_AUTH_TOKEN: ${{ secrets.GLOBAL_REPOSITORY_TOKEN }}
publish:
if: github.event_name == 'release'
runs-on: ubuntu-latest
name: publish
needs: build
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com
scope: '@percaysoinform'
- name: set the package version
run: npm version "$(jq .release.tag_name ${GITHUB_EVENT_PATH} -r)" --allow-same-version --git-tag-version=false
- name: publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}