-
Notifications
You must be signed in to change notification settings - Fork 17
77 lines (65 loc) · 1.95 KB
/
CI-CD-gear-hooks.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-CD @gear-js/react-hooks'
on:
pull_request:
branches: [main]
paths:
- utils/gear-hooks/**
push:
branches: [main]
paths:
- utils/gear-hooks/**
workflow_dispatch:
jobs:
test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Install NodeJS 18.x
uses: actions/[email protected]
with:
node-version: 18.x
- name: Install dependencies
working-directory: utils/gear-hooks
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Build pkg
working-directory: utils/gear-hooks
run: yarn build
publish-to-npm:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use node 18.x
uses: actions/[email protected]
with:
node-version: 18.x
- name: Check package version
uses: EndBug/version-check@v1
id: check
with:
file-name: utils/gear-ui/package.json
file-url: https://unpkg.com/@gear-js/react-hooks@latest/package.json
static-checking: localIsNew
- name: Install dependencies
working-directory: utils/gear-hooks
run: yarn install
- name: Build pkg
working-directory: utils/gear-hooks
run: yarn build
- name: Publish
if: steps.check.outputs.changed == 'true'
working-directory: utils/gear-hooks
run: |
export token=$(printenv $(printenv GITHUB_ACTOR))
npm config set //registry.npmjs.org/:_authToken=$token --no-workspaces
npm publish
env:
osipov-mit: ${{ secrets.OSIPOV_NPM_TOKEN }}
nikitayutanov: ${{ secrets.YUTANOV_NPM_TOKEN }}