-
Notifications
You must be signed in to change notification settings - Fork 17
74 lines (63 loc) · 1.88 KB
/
CI-CD-meta-cli.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
name: 'CI-CD @gear-js/gear-meta'
on:
pull_request:
branches: [main]
paths:
- utils/meta-cli/**
push:
branches: [main]
paths:
- utils/meta-cli/**
jobs:
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 16.x
uses: actions/setup-node@v2.1.5
with:
node-version: 16.x
- name: Prepare
run: |
mkdir utils/meta-cli/test/wasm
wget -O utils/meta-cli/test/wasm/examples.tar.gz https://github.com/gear-tech/gear/releases/download/build/examples.tar.gz
- name: Install dependencies
working-directory: utils/meta-cli
run: yarn install
- name: Run tests
working-directory: utils/meta-cli
run: |
cd test/wasm
tar -xvf examples.tar.gz
cd ../..
yarn test
publish-to-npm:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use node 16.x
uses: actions/setup-node@v2.1.5
with:
node-version: 16.x
- name: Check package version
uses: EndBug/version-check@v1
id: check
with:
file-name: utils/meta-cli/package.json
file-url: https://unpkg.com/@gear-js/gear-meta@latest/package.json
static-checking: localIsNew
- name: Publish
if: steps.check.outputs.changed == 'true'
working-directory: utils/meta-cli
run: |
export token=$(printenv $(printenv GITHUB_ACTOR))
npm config set //registry.npmjs.org/:_authToken=$token
npm publish
env:
osipov-mit: ${{ secrets.OSIPOV_NPM_TOKEN }}