@@ -13,87 +13,50 @@ jobs:
13
13
- name : Checkout source
14
14
uses : actions/checkout@v4
15
15
16
+ - name : Install pnpm
17
+ uses : pnpm/action-setup@v4
18
+ with :
19
+ version : 10
20
+ run_install : false
21
+
16
22
- name : Setup Node.js
17
23
uses : actions/setup-node@v4
18
24
with :
19
25
node-version : " latest"
26
+ cache : " pnpm"
20
27
registry-url : " https://registry.npmjs.org/"
21
28
scope : " @blueyerobotics"
22
29
23
- - name : Create tsconfig
24
- run : |
25
- cd protobuf_definitions
26
- echo '{
27
- "compilerOptions": {
28
- "target": "ES2020",
29
- "module": "CommonJS",
30
- "declaration": true,
31
- "outDir": "dist",
32
- "strict": true,
33
- "esModuleInterop": true
34
- },
35
- "include": ["./**/*.ts"]
36
- }' > tsconfig.json
37
-
38
- - name : Create package
39
- run : |
40
- cd protobuf_definitions
41
- SHORT_SHA=${GITHUB_SHA::8}
42
- echo '{
43
- "name": "@blueyerobotics/protocol-definitions",
44
- "version": "3.2.0-'${SHORT_SHA}'",
45
- "license": "LGPL-3.0-only",
46
- "description": "TypeScript definitions for Blueye Robotics protocols",
47
- "repository": {
48
- "type": "git",
49
- "url": "https://github.com/BluEye-Robotics/ProtocolDefinitions.git"
50
- },
51
- "main": "dist/index.js",
52
- "types": "dist/index.d.ts",
53
- "files": ["dist"],
54
- "scripts": {
55
- "build": "tsc"
56
- },
57
- "dependencies": {
58
- "@bufbuild/protobuf": "^2.5.2"
59
- },
60
- "devDependencies": {
61
- "ts-proto": "^2.7.5",
62
- "typescript": "^5.8.3"
63
- }
64
- }' > package.json
65
-
66
30
- name : Install dependencies
67
31
run : |
68
32
sudo apt-get update
69
33
sudo apt-get install -y protobuf-compiler
70
- cd protobuf_definitions
71
- npm install
34
+ pnpm install
72
35
73
36
- name : Generate
74
37
run : |
75
- cd protobuf_definitions
76
38
mkdir -p ./out/ &&
77
- protoc *.proto --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./out \
39
+ protoc protobuf_definitions/*.proto \
40
+ --plugin=./node_modules/.bin/protoc-gen-ts_proto \
41
+ --ts_proto_out=./out \
78
42
--ts_proto_opt=outputIndex=true \
79
43
--ts_proto_opt=globalThisPolyfill=true \
80
44
--ts_proto_opt=useExactTypes=false
81
45
82
46
- name : Compile
83
- run : |
84
- cd protobuf_definitions
85
- npm run build
47
+ run : pnpm run build
86
48
87
49
- name : Publish to npm
88
50
run : |
89
- cp README.npm.md protobuf_definitions/README.md
90
- cd protobuf_definitions
91
- npm publish --access public --tag latest
51
+ cp README.npm.md README.md
52
+ VERSION=$(pnpm pkg get version | tr -d '"')
53
+ SHORT_SHA=${GITHUB_SHA::8}
54
+ pnpm version --no-git-tag-version "${VERSION}-${SHORT_SHA}"
55
+ pnpm publish --access public --tag latest
92
56
env :
93
57
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
94
58
95
59
- name : Check npm pack contents
96
60
run : |
97
- cd protobuf_definitions
98
- npm pack
61
+ pnpm pack
99
62
tar -tzf *.tgz
0 commit comments