-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (125 loc) · 3.63 KB
/
release.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
127
128
129
130
131
132
133
name: release
on:
push:
branches:
- main
tags:
- '*.*.*'
- 'v*.*.*'
- '*.*.*-*'
- 'v*.*.*-*'
pull_request:
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rinx/[email protected]
with:
version: latest
name: vald
agents: 1
- name: check k3d
run: |
kubectl cluster-info
- uses: azure/setup-helm@v3
- name: Helm version
run: |
helm version
- name: deploy Vald
run: |
helm repo add vald https://vald.vdaas.org/charts
helm install \
--values ${VALUES} \
--set defaults.image.tag=nightly \
--set agent.ngt.dimension=300 \
--set agent.ngt.auto_index_length=2 \
--set agent.minReplicas=1 \
--set gateway.lb.enabled=false \
--set discoverer.enabled=false \
--set manager.index.enabled=false \
--generate-name vald/vald
sleep 3
kubectl wait --for=condition=ready pod -l app=vald-agent --timeout=3m
kubectl get pods
env:
VALUES: https://raw.githubusercontent.com/vdaas/vald/main/.github/helm/values/values-lb.yaml
- name: node dependencies
run: |
npm install
curl -L https://raw.githubusercontent.com/rinx/word2vecjson/master/data/wordvecs1000.json -o tests/wordvecs1000.json
- name: run tests
run: |
kubectl port-forward statefulset/vald-agent 8081:8081 &
pid=$!
npm run test
kill $pid
- name: packing for running example code
run: |
npm install
npm pack
- name: verify example codes (ts)
run: |
kubectl port-forward statefulset/vald-agent 8081:8081 &
pid=$!
version=`make vald/client/node/version/print`
npm install -g ts-node
cd example-ts
npm install ../vald-client-node-${version}.tgz -s -f
DIM=300 ts-node example.ts
kill $pid
- name: verify example codes (js)
run: |
version=`make vald/client/node/version/print`
cd example && npm install ../vald-client-node-${version}.tgz -s -f
kubectl port-forward statefulset/vald-agent 8081:8081 &
pid=$!
DIM=300 node example.js
kill $pid
publish:
if: startsWith( github.ref, 'refs/tags/')
needs:
- e2e
runs-on: ubuntu-latest
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Build
run: |
make npm/deps
export GOPATH=$HOME/go
make all
make vald/sha/update
make vald/client/node/version/update
rm -rf vald
- name: publish
run: |
npm install
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
release:
if: startsWith( github.ref, 'refs/tags/')
needs:
- e2e
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create release
if: startsWith( github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false