This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
forked from postgresml/postgresml
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (126 loc) · 3.75 KB
/
javascript-sdk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: deploy javascript sdk
on:
workflow_dispatch:
jobs:
build-javascript-sdk-macos-windows:
strategy:
matrix:
os:
[
"macos-latest",
"windows-latest",
]
include:
- neon-out-name: "x86_64-unknown-linux-gnu-index.node"
os: "ubuntu-22.04"
- neon-out-name: "aarch64-unknown-linux-gnu-index.node"
os: "buildjet-4vcpu-ubuntu-2204-arm"
- neon-out-name: "x86_64-apple-darwin-index.node"
os: "macos-latest"
- neon-out-name: "x86_64-pc-windows-gnu-index.node"
os: "windows-latest"
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: pgml-sdks/pgml/javascript
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Do build
env:
TYPESCRIPT_DECLARATION_FILE: "javascript/index.d.ts"
run: |
npm i
npm run build-release
- name: Upload built .node file
uses: actions/upload-artifact@v3
with:
name: node-artifacts
path: pgml-sdks/pgml/javascript/dist/${{ matrix.neon-out-name }}
retention-days: 1
build-javascript-sdk-linux:
strategy:
matrix:
os:
[
"ubuntu-22.04",
"buildjet-4vcpu-ubuntu-2204-arm",
]
include:
- neon-out-name: "x86_64-unknown-linux-gnu-index.node"
os: "ubuntu-22.04"
- neon-out-name: "aarch64-unknown-linux-gnu-index.node"
os: "buildjet-4vcpu-ubuntu-2204-arm"
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
defaults:
run:
working-directory: pgml-sdks/pgml/javascript
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
yum install -y perl-IPC-Cmd
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Do build
env:
TYPESCRIPT_DECLARATION_FILE: "javascript/index.d.ts"
run: |
npm i
npm run build-release
- name: Upload built .node file
uses: actions/upload-artifact@v3
with:
name: node-artifacts
path: pgml-sdks/pgml/javascript/dist/${{ matrix.neon-out-name }}
retention-days: 1
# publish-javascript-sdk:
# needs: build-javascript-sdk
# runs-on: "ubuntu-22.04"
# defaults:
# run:
# working-directory: pgml-sdks/rust/pgml/javascript
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# - name: Validate cargo is working
# uses: postgresml/gh-actions-cargo@master
# with:
# command: version
# - name: Create artifact directory
# run: mkdir dist
# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# name: node-artifacts
# path: pgml-sdks/rust/pgml/javascript/dist
# - uses: actions/setup-node@v3
# with:
# node-version: '20.x'
# registry-url: 'https://registry.npmjs.org'
# - name: Generate types declaration
# run: |
# npm i
# npm run build
# rm index.node
# - run: npm ci
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}