Upload pre-compiled binaries and libraries on release (#206)

This commit is contained in:
Fangjun Kuang
2023-07-10 17:59:08 +08:00
committed by GitHub
parent 4eacbed0b2
commit 0b5fa24134
10 changed files with 304 additions and 38 deletions

View File

@@ -5,6 +5,8 @@ on:
push:
branches:
- master
tags:
- '*'
paths:
- '.github/workflows/aarch64-linux-gnu.yaml'
- 'CMakeLists.txt'
@@ -20,14 +22,25 @@ on:
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
release:
types:
- published
workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean
env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}
concurrency:
group: aarch64-linux-gnu-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
aarch64_linux_gnu:
runs-on: ${{ matrix.os }}
@@ -118,7 +131,31 @@ jobs:
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc
ls -lh ./build-aarch64-linux-gnu/bin
qemu-aarch64 ./build-aarch64-linux-gnu/bin/sherpa-onnx --help
- name: Copy files
if: env.RELEASE == 'true'
shell: bash
run: |
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64
mkdir $dst
cp -a build-aarch64-linux-gnu/install/bin $dst/
cp -a build-aarch64-linux-gnu/install/lib $dst/
cp -a build-aarch64-linux-gnu/install/include $dst/
tree $dst
tar cjvf ${dst}.tar.bz2 $dst
- name: Release pre-compiled binaries and libs for aarch64 linux
if: env.RELEASE == 'true'
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
overwrite: true
file: sherpa-onnx-*linux-aarch64.tar.bz2