publish-standalone #136
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |