Lua building #250
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: Build Lua | |
run-name: Lua building | |
on: [push, pull_request] | |
permissions: | |
contents: write | |
pull-requests: read | |
jobs: | |
builds_linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
archit: [x86_64, arm, aarch64] | |
include: | |
- archit: x86_64 | |
target: x86_64-unknown-linux-gnu | |
- archit: arm | |
target: armv7-unknown-linux-gnueabihf | |
- archit: aarch64 | |
target: aarch64-unknown-linux-gnu | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Build | |
uses: mosteo-actions/docker-run@v2 | |
with: | |
image: registry.cn-shanghai.aliyuncs.com/lebai/util:14.04 | |
host-dir: "." | |
guest-dir: /app | |
command: | | |
cargo build --release --features ffi_lua,module,mdns --target ${{matrix.target}} | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Lebai_Lua_SDK_Linux_${{matrix.archit}} | |
path: | | |
./target/${{matrix.target}}/release/liblebai_sdk.so | |
builds_macos: | |
strategy: | |
fail-fast: false | |
matrix: | |
archit: [x86_64, aarch64] | |
include: | |
- archit: x86_64 | |
target: x86_64-apple-darwin | |
- archit: aarch64 | |
target: aarch64-apple-darwin | |
runs-on: macos-13 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
continue-on-error: true | |
- name: Build | |
run: cargo build --release --features ffi_lua,module,mdns --target ${{matrix.target}} | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Lebai_Lua_SDK_MacOS_${{matrix.archit}} | |
path: | | |
./target/${{matrix.target}}/release/liblebai_sdk.dylib | |
builds_windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
archit: [x86_64] | |
include: | |
- archit: x86_64 | |
target: x86_64-pc-windows-gnu | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
install: >- | |
mingw-w64-x86_64-rust | |
mingw-w64-x86_64-protobuf | |
mingw-w64-x86_64-lua | |
mingw-w64-x86_64-pkg-config | |
- uses: Swatinem/rust-cache@v2 | |
continue-on-error: true | |
- name: Build | |
run: cargo build --release --features ffi_lua,module,mdns --target ${{matrix.target}} | |
shell: msys2 {0} | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Lebai_Lua_SDK_Windows_${{matrix.archit}} | |
path: | | |
./target/${{matrix.target}}/release/lebai_sdk.dll | |
release: | |
if: ${{ contains(github.ref, 'tags/v') }} | |
needs: [builds_linux, builds_macos, builds_windows] | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/download-artifact@v3 | |
- name: Zip Artifact | |
run: for dir in `ls`; do zip -r ${dir}.zip ${dir}; done | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: false | |
prerelease: false | |
files: | | |
* |