-
Notifications
You must be signed in to change notification settings - Fork 17
121 lines (103 loc) · 3.31 KB
/
CI-CD-gear-ui.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: 'CI-CD @gear-js/ui'
on:
pull_request:
branches: [main]
paths:
- utils/gear-ui/**
- utils/vara-ui/**
push:
branches: [main]
paths:
- utils/gear-ui/**
- utils/vara-ui/**
workflow_dispatch:
jobs:
gear-ui-test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Install NodeJS 18.x
uses: actions/setup-node@v2.1.5
with:
node-version: 18.x
- name: 'gear-ui: Install dependencies'
working-directory: utils/gear-ui
run: yarn install
- name: 'gear-ui: Build pkg'
working-directory: utils/gear-ui
run: yarn build
- name: 'gear-ui: Run tests'
working-directory: utils/gear-ui
run: yarn test
vara-ui-build:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Install NodeJS 18.x
uses: actions/setup-node@v2.1.5
with:
node-version: 18.x
- name: 'vara-ui: Install dependencies'
working-directory: utils/vara-ui
run: npm install
- name: 'vara-ui: Build pkg'
working-directory: utils/vara-ui
run: npm run build
publish-to-npm:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: Use node 18.x
uses: actions/setup-node@v2.1.5
with:
node-version: 18.x
- name: '@gear-js/ui: Check pkg version'
uses: EndBug/version-check@v1
id: check_gear
with:
file-name: utils/gear-ui/package.json
file-url: https://unpkg.com/@gear-js/ui@latest/package.json
static-checking: localIsNew
- name: '@gear-js/vara-ui: Check pkg version'
uses: EndBug/version-check@v1
id: check_vara
with:
file-name: utils/vara-ui/package.json
file-url: https://unpkg.com/@gear-js/vara-ui@latest/package.json
static-checking: localIsNew
- name: '@gear-js/ui: Publish'
if: steps.check_gear.outputs.changed == 'true'
working-directory: utils/gear-ui
run: |
export token=$(printenv $(printenv GITHUB_ACTOR))
npm install
npm run build
npm config set //registry.npmjs.org/:_authToken=$token --no-workspaces
npm publish
env:
osipov-mit: ${{ secrets.OSIPOV_NPM_TOKEN }}
nikitayutanov: ${{ secrets.YUTANOV_NPM_TOKEN }}
- name: '@gear-js/vara-ui: Publish'
if: steps.check_vara.outputs.changed == 'true'
working-directory: utils/vara-ui
run: |
export token=$(printenv $(printenv GITHUB_ACTOR))
npm install
npm run build
npm config set //registry.npmjs.org/:_authToken=$token --no-workspaces
npm publish
env:
osipov-mit: ${{ secrets.OSIPOV_NPM_TOKEN }}
nikitayutanov: ${{ secrets.YUTANOV_NPM_TOKEN }}