Skip to content

Commit 194794d

Browse files
committed
chore: Run npm ci before code generation
1 parent 53fe113 commit 194794d

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: publish
2+
on:
3+
push:
4+
tags:
5+
- "v*.*.*"
6+
7+
jobs:
8+
publish:
9+
name: Publish to npm
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
cache: "npm"
16+
node-version: "16"
17+
18+
- name: Install dependencies
19+
run: npm ci
20+
21+
- name: Generate code
22+
run: |
23+
npm run build
24+
25+
- run: npm publish --access public
26+
env:
27+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/regen.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ jobs:
1717
node-version: "16"
1818

1919
- name: Install dependencies
20-
run: |
21-
npm ci
20+
run: npm ci
2221

2322
- name: Generate code
2423
run: |

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"proto-clone": "git clone https://github.com/cloudquery/plugin-pb",
99
"proto-prepare": "cd plugin-pb && git pull && cd .. && rm -rf ./protos && mkdir -p ./protos/plugin/v3 && mkdir -p ./protos/discovery/v1 && cp -r ./plugin-pb/plugin/v3/* ./protos/plugin/v3 && cp -r ./plugin-pb/discovery/v1/* ./protos/discovery/v1",
1010
"proto-gen": "grpc_tools_node_protoc --ts_out=grpc_ts:. ./protos/plugin/v3/*.proto ./protos/discovery/v1/*.proto",
11-
"build": "npm run proto-prepare && npm run proto-gen && rm -rf dist && tsc",
11+
"build": "rm -rf dist && tsc",
12+
"all": "npm run proto-prepare && npm run proto-gen && npm run build",
1213
"test": "gulp test"
1314
},
1415
"description": "This is a low-level auto-generated gRPC client and server for CloudQuery plugins",
@@ -44,5 +45,6 @@
4445
},
4546
"engines": {
4647
"node": ">=16.17.0"
47-
}
48+
},
49+
"main": "index.js"
4850
}

0 commit comments

Comments
 (0)