@@ -2,7 +2,7 @@ name: deploy javascript sdk
2
2
on :
3
3
workflow_dispatch :
4
4
jobs :
5
- build-javascript-sdk-linux :
5
+ build-javascript-sdk :
6
6
strategy :
7
7
matrix :
8
8
os : ["ubuntu-22.04", "buildjet-4vcpu-ubuntu-2204-arm", "macos-latest", "windows-latest"]
13
13
os : " buildjet-4vcpu-ubuntu-2204-arm"
14
14
- neon-out-name : " x86_64-apple-darwin-index.node"
15
15
os : " macos-latest"
16
- - neon-out-name : " x86_64-pc-windows-gnu.node"
16
+ - neon-out-name : " x86_64-pc-windows-gnu-index .node"
17
17
os : " windows-latest"
18
18
runs-on : ${{ matrix.os }}
19
19
defaults :
@@ -29,28 +29,50 @@ jobs:
29
29
with :
30
30
command : version
31
31
- name : Do build
32
- env :
33
- NEON_OUT_NAME : ${{ matrix.neon-out-name }}
34
32
run : |
35
33
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
37
38
- name : Upload built .node file
38
39
uses : actions/upload-artifact@v3
39
40
with :
40
41
name : node-artifacts
41
- path : ${{ matrix.neon-out-name }}
42
+ path : pgml-sdks/rust/pgml/javascript/ ${{ matrix.neon-out-name }}
42
43
retention-days : 1
43
44
publish-javascript-sdk :
45
+ needs : build-javascript-sdk
44
46
runs-on : " ubuntu-22.04"
45
47
defaults :
46
48
run :
47
49
working-directory : pgml-sdks/rust/pgml/javascript
48
50
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
49
59
- name : Create artifact directory
50
60
run : mkdir dist
51
- - uses : actions/download-artifact@v3
61
+ - name : Download artifacts
62
+ uses : actions/download-artifact@v3
52
63
with :
53
64
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