-
Notifications
You must be signed in to change notification settings - Fork 5
85 lines (70 loc) · 2 KB
/
sails-js.yaml
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
name: 'CI-CD sails-js'
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
branches: [master]
push:
branches: [master]
paths:
- js/**
workflow_dispatch:
jobs:
test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-22.04
env:
RUSTUP_HOME: /tmp/rustup_home
steps:
- name: Cancel previous workflow runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v3
- name: "Install: NodeJS 18.x"
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: "Install: pkg dependencies"
working-directory: js
run: yarn install
- name: "Build: sails-js"
working-directory: js
run: yarn build
- name: "Test: run"
working-directory: js
run: yarn test
publish-to-npm:
if: github.event_name == 'push'
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use node 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Check package version
uses: EndBug/version-check@v1
id: check
with:
file-name: js/package.json
file-url: https://unpkg.com/sails-js@latest/package.json
static-checking: localIsNew
- name: Install dependencies
if: steps.check.outputs.changed == 'true'
working-directory: js
run: yarn install
- name: Build sails-js
if: steps.check.outputs.changed == 'true'
working-directory: js
run: yarn build
- name: Publish
if: steps.check.outputs.changed == 'true'
working-directory: js
run: |
export token=$(printenv $(printenv GITHUB_ACTOR))
npm config set //registry.npmjs.org/:_authToken=$token
npm publish
env:
osipov-mit: ${{ secrets.OSIPOV_NPM_TOKEN }}