-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (124 loc) · 4.79 KB
/
standalone.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: publish-standalone
on: [ push ]
env:
node_ver: v16.14.0
GIT_TERMINAL_PROMPT: 1
jobs:
bundle-bash:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: [ self-hosted, Linux, X64, generic ]
format: .tar.xz
node_suffix: linux-x64
dist_suffix: linux_x64-v2
- os: [ self-hosted, macOS, X64, generic ]
format: .tar.gz
node_suffix: darwin-x64
dist_suffix: darwin_x64-v2
steps:
- uses: actions/checkout@v4
- name: Download Node distribution
run: wget --no-check-certificate -nv http://${{ secrets.LRS_RES_SERVER }}:9000/public/node/${{ env.node_ver }}/node-${{ env.node_ver }}-${{ matrix.node_suffix }}${{ matrix.format }}
- name: Extract Node
run: |
export XZ_OPT="-T0"
tar xf node-${{ env.node_ver }}-${{ matrix.node_suffix }}${{ matrix.format }}
mv node-${{ env.node_ver }}-${{ matrix.node_suffix }} node
- name: Install zx & lisa
run: |
export PATH=$PWD/node/bin:$PATH
export npm_config_prefix=$PWD/node
export npm_config_registry=https://registry.npmmirror.com
npm prefix -g
npm root -g
npm bin -g
npm i -g zx
npm install -g @listenai/lisa
npm install -g yarn
- name: Install Plugins
run: |
export PATH=$PWD/node/bin:$PATH
export npm_config_prefix=$PWD/node
zx main.mjs
mv $HOME/.listenai/lisa-zephyr/packages $PWD/node
- name: Make bundle
run: |
cp -vR standalone/bash node/libexec
export XZ_OPT="-T0"
cd node && tar caf ../csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }} .
- name: Upload cache (local)
run: |
mc cp ./csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }} local/${{ secrets.LRS_MINIO_BUCKET }}/
test-bash:
needs: bundle-bash
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: [ self-hosted, Linux, X64, generic ]
format: .tar.xz
dist_suffix: linux_x64-v2
- os: [ self-hosted, macOS, X64, generic ]
format: .tar.gz
dist_suffix: darwin_x64-v2
steps:
- name: Remove pre-installed Node
run: |
(which node && rm -f $(which node) && echo Node removed) || echo Already removed
- name: Download cache (local)
run: |
mc cp local/${{ secrets.LRS_MINIO_BUCKET }}/csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }} .
- name: Extract LISA
run: |
mkdir -p $HOME/.listenai/lisa
export XZ_OPT="-T0"
tar xf csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }} -C $HOME/.listenai/lisa
- name: Test LISA
run: |
export PATH=$HOME/.listenai/lisa/libexec:$PATH
export PATH=$HOME/.listenai/lisa/bin:$PATH
$HOME/.listenai/lisa/bin/node -e "console.log(require('os').platform())"
echo $PATH
lisa info zephyr
- name: Upload to oss
id: upload_to_oss
uses: listenai-jw/upload-to-oss@master
if: github.ref == 'refs/heads/master'
with:
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
endpoint: https://oss-cn-shanghai.aliyuncs.com
bucket: iflyos-external
assets: |
csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }}:/public/cskTools/lisa-zephyr-${{ matrix.dist_suffix }}${{ matrix.format }}
- name: Upload to artifacts (for docker)
uses: actions/upload-artifact@v4
if: matrix.dist_suffix == 'linux_x64-v2'
with:
name: csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }}
path: csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }}
publish-docker:
needs: test-bash
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: csk-integration-bus-linux_x64-v2.tar.xz
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: listenai/csk6:latest,listenai/csk6:2.0.0-24091101