@@ -13,87 +13,50 @@ jobs:
1313 - name : Checkout source
1414 uses : actions/checkout@v4
1515
16+ - name : Install pnpm
17+ uses : pnpm/action-setup@v4
18+ with :
19+ version : 10
20+ run_install : false
21+
1622 - name : Setup Node.js
1723 uses : actions/setup-node@v4
1824 with :
1925 node-version : " latest"
26+ cache : " pnpm"
2027 registry-url : " https://registry.npmjs.org/"
2128 scope : " @blueyerobotics"
2229
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-
6630 - name : Install dependencies
6731 run : |
6832 sudo apt-get update
6933 sudo apt-get install -y protobuf-compiler
70- cd protobuf_definitions
71- npm install
34+ pnpm install
7235
7336 - name : Generate
7437 run : |
75- cd protobuf_definitions
7638 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 \
7842 --ts_proto_opt=outputIndex=true \
7943 --ts_proto_opt=globalThisPolyfill=true \
8044 --ts_proto_opt=useExactTypes=false
8145
8246 - name : Compile
83- run : |
84- cd protobuf_definitions
85- npm run build
47+ run : pnpm run build
8648
8749 - name : Publish to npm
8850 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
9256 env :
9357 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
9458
9559 - name : Check npm pack contents
9660 run : |
97- cd protobuf_definitions
98- npm pack
61+ pnpm pack
9962 tar -tzf *.tgz
0 commit comments