Skip to content

update checkout

update checkout #249

Workflow file for this run

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
- os: [ self-hosted, macOS, X64, generic ]
format: .tar.gz
node_suffix: darwin-x64
dist_suffix: darwin_x64
steps:
- uses: actions/checkout@v2
- 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: Check-out listenai-local-cache library
uses: actions/checkout@v3
with:
repository: LISTENAI/runner-local-cache
ref: v1.0.4
path: './runner-local-cache'
token: ${{ secrets.ACTION_CHECKOUT_TOKEN }}
- name: Upload artifacts (local)
uses: ./runner-local-cache
with:
host: ${{ secrets.LRS_RES_SERVER }}
port: ${{ secrets.LRS_RES_PORT }}
mode: Upload
username: ${{ secrets.LRS_RES_USER }}
password: ${{ secrets.LRS_RES_TOKEN }}
source: ./csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }}
destination: /interchange/csk-integration-bus-${{ 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 && dependencies
# run: |
# $env:Path = "$pwd\node;$env:Path"
# $env:npm_config_prefix = "$pwd\node"
# npm prefix -g
# npm root -g
# npm bin -g
# npm i -g zx
# npm install -g @listenai/lisa@beta
# npm install -g yarn
# npm install -g innosetup-compiler iconv-lite
# npm install iconv-lite
# - name: Install Plugins
# run: |
# $env:Path = "$pwd\node;$env:Path"
# $env:npm_config_prefix = "$pwd\node"
# zx main.mjs
# - 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 }}
# $env:Path = "$pwd\node;$env:Path"
# $env:npm_config_prefix = "$pwd\node"
# zx prepack.mjs
# innosetup-compiler lisaiss.iss --O=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: [ self-hosted, Linux, X64, generic ]
format: .tar.xz
dist_suffix: linux_x64
- os: [ self-hosted, macOS, X64, generic ]
format: .tar.gz
dist_suffix: darwin_x64
steps:
- name: Remove pre-installed Node
run: |
(which node && rm -f $(which node) && echo Node removed) || echo Already removed
- name: Check-out listenai-local-cache library
uses: actions/checkout@v3
with:
repository: LISTENAI/runner-local-cache
ref: v1.0.4
path: './runner-local-cache'
token: ${{ secrets.ACTION_CHECKOUT_TOKEN }}
- name: Download artifacts (local)
uses: ./runner-local-cache
with:
host: ${{ secrets.LRS_RES_SERVER }}
port: ${{ secrets.LRS_RES_PORT }}
mode: Download
username: ${{ secrets.LRS_RES_USER }}
password: ${{ secrets.LRS_RES_TOKEN }}
source: /interchange/csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }}
destination: ./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@v3
if: matrix.dist_suffix == 'linux_x64'
with:
name: csk-integration-bus-${{ matrix.dist_suffix }}${{ matrix.format }}
path: csk-integration-bus-${{ 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
# - 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 }}
publish-docker:
needs: test-bash
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: csk-integration-bus-linux_x64.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