-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (130 loc) · 3.82 KB
/
lua.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
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, aarch64]
include:
- archit: x86_64
target: x86_64-unknown-linux-gnu
- archit: aarch64
target: aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
container: registry.cn-shanghai.aliyuncs.com/lebai/util:14.04
steps:
- 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
- name: Install Cross Compiler
if: ${{ matrix.archit == 'aarch64' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
run: cargo build --release --features ffi_lua,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-latest
steps:
- 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
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
run: cargo build --release --features ffi_lua,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-latest
steps:
- 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
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
run: cargo build --release --features ffi_lua,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-latest
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: |
*