-
Notifications
You must be signed in to change notification settings - Fork 0
192 lines (160 loc) · 5.49 KB
/
publish-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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: publish-standalone
on:
workflow_run:
workflows: ["publish-beta", 'publish-latest']
types: [completed]
env:
node_ver: v16.14.0
jobs:
bundle-bash:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
format: .tar.xz
node_suffix: linux-x64
dist_suffix: linux_x64
- os: macos-latest
format: .tar.gz
node_suffix: darwin-x64
dist_suffix: darwin_x64
steps:
- uses: actions/checkout@v2
- name: Download Node distribution
run: wget https://nodejs.org/dist/${{ env.node_ver }}/node-${{ env.node_ver }}-${{ matrix.node_suffix }}${{ matrix.format }}
- name: Extract Node
run: |
tar xf node-${{ env.node_ver }}-${{ matrix.node_suffix }}${{ matrix.format }}
mv node-${{ env.node_ver }}-${{ matrix.node_suffix }} node
- name: Install LISA
run: |
export PATH=$PWD/node/bin:$PATH
export npm_config_prefix=$PWD/node
npm prefix -g
npm root -g
npm bin -g
npm install -g @listenai/lisa@beta
npm install -g yarn
npm install -g @lisa-plugin/zephyr --registry=https://registry-lpm.listenai.com
- name: Make bundle
run: |
cp -vR standalone/bash node/libexec
cd node && tar caf ../lisa-standalone-${{ matrix.dist_suffix }}${{ matrix.format }} .
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: lisa-standalone-${{ matrix.dist_suffix }}
path: lisa-standalone-${{ matrix.dist_suffix }}${{ matrix.format }}
# bundle-pwsh:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# include:
# - os: windows-latest
# format: .zip
# node_suffix: win-x64
# dist_suffix: win32_x64
# steps:
# - uses: actions/checkout@v2
# - name: Download Node distribution
# run: Invoke-WebRequest https://nodejs.org/dist/${{ env.node_ver }}/node-${{ env.node_ver }}-${{ matrix.node_suffix }}${{ matrix.format }} -OutFile node-${{ env.node_ver }}-${{ matrix.node_suffix }}${{ matrix.format }}
# - name: Extract Node
# run: |
# unzip node-${{ env.node_ver }}-${{ matrix.node_suffix }}${{ matrix.format }}
# mv node-${{ env.node_ver }}-${{ matrix.node_suffix }} node
# - name: Install LISA
# run: |
# $env:Path = "$pwd\node;$env:Path"
# $env:npm_config_prefix = "$pwd\node"
# npm prefix -g
# npm root -g
# npm bin -g
# npm install -g @listenai/lisa@beta
# npm install -g yarn
# - name: Make bundle
# run: |
# Copy-Item -Path standalone\pwsh -Destination node\bin -Recurse
# Compress-Archive -Path node\* -DestinationPath lisa-standalone-${{ matrix.dist_suffix }}${{ matrix.format }}
# - name: Upload artifact
# uses: actions/upload-artifact@v2
# with:
# name: lisa-standalone-${{ matrix.dist_suffix }}
# path: lisa-standalone-${{ matrix.dist_suffix }}${{ matrix.format }}
test-bash:
needs: bundle-bash
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
format: .tar.xz
dist_suffix: linux_x64
- os: macos-latest
format: .tar.gz
dist_suffix: darwin_x64
steps:
- name: Remove pre-installed Node
run: |
which node
node -v
rm -f `which node`
node -v || echo Node removed
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: lisa-standalone-${{ matrix.dist_suffix }}
- name: Extract LISA
run: |
mkdir -p $HOME/.listenai/lisa
tar xf lisa-standalone-${{ 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: tvrcgo/upload-to-oss@master
with:
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
region: oss-cn-shanghai
bucket: iflyos-external
assets: |
lisa-standalone-${{ matrix.dist_suffix }}${{ matrix.format }}:/public/cskTools/lisa-zephyr-${{ matrix.dist_suffix }}${{ matrix.format }}
# test-pwsh:
# needs: bundle-pwsh
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# include:
# - os: windows-latest
# format: .zip
# dist_suffix: win32_x64
# steps:
# - name: Remove pre-installed Node
# run: |
# Get-Command node
# node -v
# Remove-Item "C:\Program Files\nodejs" -Recurse
# - name: Download artifact
# uses: actions/download-artifact@v2
# with:
# name: lisa-standalone-${{ matrix.dist_suffix }}
# - name: Extract LISA
# run: |
# New-Item -Path $env:USERPROFILE\.listenai\lisa -ItemType Directory -Force
# unzip lisa-standalone-${{ matrix.dist_suffix }}${{ matrix.format }} -d $env:USERPROFILE\.listenai\lisa
# - name: Test LISA (pwsh)
# shell: pwsh
# run: |
# $env:Path = "$env:USERPROFILE\.listenai\lisa\bin;$env:Path"
# lisa info
# - name: Test LISA (cmd)
# shell: cmd
# run: |
# set Path=%USERPROFILE%\.listenai\lisa;%Path%
# lisa info