-
-
Notifications
You must be signed in to change notification settings - Fork 7
77 lines (67 loc) · 2.23 KB
/
build.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
66
67
68
69
70
71
72
73
74
75
76
77
name: CI
on: [push]
jobs:
build-core:
name: Build Core on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [14, 16, 18]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: npm install, build and test
run: |
cd core
npm install
npm test
build-cli:
name: Build CLI on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [14, 16, 18]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: npm install, build and test
run: |
cd cli
npm install
npm install . -g
npm test
deploy:
needs: [build-core, build-cli]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- name: publish release package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
(cd core && npm i && npm publish)
(cd cli && npm i && npm publish)
if: github.ref == 'master'
- name: publish preview package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
PACKAGE_VERSION=$(node -p -e "require('./core/package.json').version")
CURRENT_TIME=$(date +%s)
NEW_VERSION=${PACKAGE_VERSION}-build${CURRENT_TIME}
(cd core && npm i && npm version $NEW_VERSION --no-git-tag-version && npm publish --tag next)
(cd cli && npm i && npm i galenframework@next --E && npm version $NEW_VERSION && npm publish --tag next)
if: github.ref == 'develop'