@@ -15,36 +15,62 @@ jobs:
15
15
with :
16
16
node-version : " latest"
17
17
18
+ - name : Create tsconfig
19
+ run : |
20
+ cd protobuf_definitions
21
+ echo '{
22
+ "compilerOptions": {
23
+ "target": "ES2020",
24
+ "module": "CommonJS",
25
+ "declaration": true,
26
+ "outDir": "dist",
27
+ "strict": true,
28
+ "esModuleInterop": true
29
+ },
30
+ "include": ["./**/*.ts"]
31
+ }' > tsconfig.json
32
+
33
+ - name : Create package
34
+ run : |
35
+ cd protobuf_definitions
36
+ SHORT_SHA=${GITHUB_SHA::8}
37
+ echo '{
38
+ "name": "@blueye-robotics/protocol-definitions",
39
+ "version": "0.0.0-'${SHORT_SHA}'",
40
+ "main": "out/dist/index.js",
41
+ "types": "out/dist/index.d.ts",
42
+ "files": ["out/dist"],
43
+ "publishConfig": {
44
+ "registry": "https://npm.pkg.github.com/"
45
+ },
46
+ "scripts": {
47
+ "build": "tsc"
48
+ },
49
+ "devDependencies": {
50
+ "ts-proto": "^2.7.5",
51
+ "typescript": "^5.8.3"
52
+ },
53
+ }' > package.json
54
+
18
55
- name : Install dependencies
19
56
run : |
20
57
sudo apt-get update
21
58
sudo apt-get install -y protobuf-compiler
22
59
cd protobuf_definitions
23
- npm init -y
24
- npm install -D ts-proto
60
+ npm install
25
61
26
- - name : Compile
62
+ - name : Generate
27
63
run : |
28
64
cd protobuf_definitions
29
65
mkdir -p ./out/ &&
30
66
protoc *.proto --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./out --ts_proto_opt=outputIndex=true
31
67
32
- - name : Create package
68
+ - name : Compile
33
69
run : |
34
- cd protobuf_definitions/out
35
- SHORT_SHA=${GITHUB_SHA::8}
36
- echo '{
37
- "name": "@blueye-robotocs/protocol-definitions",
38
- "version": "0.0.0-'${SHORT_SHA}'",
39
- "main": "index.js",
40
- "types": "index.d.ts",
41
- "files": ["."],
42
- "publishConfig": {
43
- "registry": "https://npm.pkg.github.com/"
44
- }
45
- }' > package.json
70
+ cd protobuf_definitions
71
+ npm run build
46
72
47
73
- name : Publish compiled proto definitions
48
74
uses : actions/upload-artifact@v4
49
75
with :
50
- path : protobuf_definitions/out
76
+ path : protobuf_definitions
0 commit comments