@@ -2,7 +2,7 @@ name: deploy javascript sdk
22on :
33 workflow_dispatch :
44jobs :
5- build-javascript-sdk-linux :
5+ build-javascript-sdk :
66 strategy :
77 matrix :
88 os : ["ubuntu-22.04", "buildjet-4vcpu-ubuntu-2204-arm", "macos-latest", "windows-latest"]
1313 os : " buildjet-4vcpu-ubuntu-2204-arm"
1414 - neon-out-name : " x86_64-apple-darwin-index.node"
1515 os : " macos-latest"
16- - neon-out-name : " x86_64-pc-windows-gnu.node"
16+ - neon-out-name : " x86_64-pc-windows-gnu-index .node"
1717 os : " windows-latest"
1818 runs-on : ${{ matrix.os }}
1919 defaults :
@@ -29,28 +29,50 @@ jobs:
2929 with :
3030 command : version
3131 - name : Do build
32- env :
33- NEON_OUT_NAME : ${{ matrix.neon-out-name }}
3432 run : |
3533 npm i
36- npm run build-named
34+ npm run build-release
35+ mv index.node ${{ matrix.neon-out-name }}
36+ - name : Display output files
37+ run : ls -R
3738 - name : Upload built .node file
3839 uses : actions/upload-artifact@v3
3940 with :
4041 name : node-artifacts
41- path : ${{ matrix.neon-out-name }}
42+ path : pgml-sdks/rust/pgml/javascript/ ${{ matrix.neon-out-name }}
4243 retention-days : 1
4344 publish-javascript-sdk :
45+ needs : build-javascript-sdk
4446 runs-on : " ubuntu-22.04"
4547 defaults :
4648 run :
4749 working-directory : pgml-sdks/rust/pgml/javascript
4850 steps :
51+ - uses : actions/checkout@v3
52+ - uses : actions-rs/toolchain@v1
53+ with :
54+ toolchain : stable
55+ - name : Validate cargo is working
56+ uses : postgresml/gh-actions-cargo@master
57+ with :
58+ command : version
4959 - name : Create artifact directory
5060 run : mkdir dist
51- - uses : actions/download-artifact@v3
61+ - name : Download artifacts
62+ uses : actions/download-artifact@v3
5263 with :
5364 name : node-artifacts
54- path : dist
55- - name : Display structure of download-artifacts
56- run : ls -R dist
65+ path : pgml-sdks/rust/pgml/javascript/dist
66+ - uses : actions/setup-node@v3
67+ with :
68+ node-version : ' 20.x'
69+ registry-url : ' https://registry.npmjs.org'
70+ - name : Generate types declaration
71+ run : |
72+ npm i
73+ npm run build
74+ rm index.node
75+ - run : npm ci
76+ - run : npm publish
77+ env :
78+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments