-
Notifications
You must be signed in to change notification settings - Fork 4
168 lines (162 loc) · 5.67 KB
/
Copy pathrule-engine.yml
File metadata and controls
168 lines (162 loc) · 5.67 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: rule-engine rust
on:
workflow_dispatch:
inputs:
osName:
description: '编译系统'
required: true
default: 'windows'
type: choice
options:
- windows
- ubuntu
- macos
rustChannel:
description: 'rust通道'
required: true
default: 'stable'
type: choice
options:
- stable
- nightly
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10
jobs:
windows-build:
name: windows-${{ matrix.arch }} ${{ inputs.rustChannel }} build
if: ${{ inputs.osName == 'windows'}}
strategy:
fail-fast: true
matrix:
arch:
- x86_64
runs-on: ${{ inputs.osName }}-latest
permissions:
contents: read
packages: write
environment: rule-engine
steps:
- uses: actions/checkout@v4.1.1
name: checkout code
- name: Install Rust
run: |
rustup update ${{ inputs.rustChannel }}
rustup default ${{ inputs.rustChannel }}
- name: Install Ossutil
# You may pin to the exact commit or the version.
# uses: manyuanrong/setup-ossutil@b74103470b3890349167a84773d33158511cf11d
uses: yizhoumo/setup-ossutil@v1
with:
endpoint: oss-cn-shenzhen.aliyuncs.com
access-key-id: ${{ secrets.ACCESS_KEY }}
access-key-secret: ${{ secrets.SECRET_KEY }}
ossutil-version: '1.7.16'
- name: rust build
run: |
echo $PWD
cd boot-extension/rule-engine/src/main/rust
echo $PWD
rustup target add ${{ matrix.arch }}-pc-windows-msvc
cargo build --release --target ${{ matrix.arch }}-pc-windows-msvc
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
- name: Copy
run: |
cd boot-extension/rule-engine/src/main/rust
cp ./target/${{ matrix.arch }}-pc-windows-msvc/release/zen_engine.dll ../resources/zen_engine-windows-${{ matrix.arch }}.dll
- name: Upload
run: |
cd boot-extension/rule-engine
ossutil cp ./src/main/resources/zen_engine-windows-${{ matrix.arch }}.dll oss://workoss/static/${{ inputs.rustChannel }}/zen_engine-windows-${{ matrix.arch }}.dll
ubuntu-build:
name: linux-${{ matrix.arch }} ${{ inputs.rustChannel }} build
if: ${{ inputs.osName == 'ubuntu'}}
strategy:
fail-fast: true
matrix:
arch:
- x86_64
# - aarch64
runs-on: ${{ inputs.osName }}-latest
permissions:
contents: read
packages: write
environment: rule-engine
steps:
- uses: actions/checkout@v3
name: checkout code
- name: Install Rust
run: |
rustup update ${{ inputs.rustChannel }}
rustup default ${{ inputs.rustChannel }}
- name: Install Ossutil
# You may pin to the exact commit or the version.
# uses: manyuanrong/setup-ossutil@b74103470b3890349167a84773d33158511cf11d
uses: yizhoumo/setup-ossutil@v1
with:
endpoint: oss-cn-shenzhen.aliyuncs.com
access-key-id: ${{ secrets.ACCESS_KEY }}
access-key-secret: ${{ secrets.SECRET_KEY }}
ossutil-version: '1.7.16'
- name: rust build
run: |
echo $PWD
cd boot-extension/rule-engine/src/main/rust
echo $PWD
rustup target add ${{ matrix.arch }}-unknown-linux-gnu
cargo build --release --target ${{ matrix.arch }}-unknown-linux-gnu
- name: Copy
run: |
cd boot-extension/rule-engine/src/main/rust
cp -f target/${{ matrix.arch }}-unknown-linux-gnu/release/libzen_engine.so ../resources/libzen_engine-linux-${{ matrix.arch }}.so
- name: Upload
run: |
cd boot-extension/rule-engine
ossutil cp ./src/main/resources/libzen_engine-linux-${{ matrix.arch }}.so oss://workoss/static/${{ inputs.rustChannel }}/libzen_engine-linux-${{ matrix.arch }}.so
macos-build:
name: osx-${{ matrix.arch }} ${{ inputs.rustChannel }} build
if: ${{ inputs.osName == 'macos'}}
strategy:
fail-fast: true
matrix:
arch:
- x86_64
- aarch64
runs-on: ${{ inputs.osName }}-latest
permissions:
contents: read
packages: write
environment: rule-engine
steps:
- uses: actions/checkout@v3
name: checkout code
- name: Install Rust
run: |
rustup update ${{ inputs.rustChannel }}
rustup default ${{ inputs.rustChannel }}
- name: Install Ossutil
# You may pin to the exact commit or the version.
# uses: manyuanrong/setup-ossutil@b74103470b3890349167a84773d33158511cf11d
uses: yizhoumo/setup-ossutil@v1
with:
endpoint: oss-cn-shenzhen.aliyuncs.com
access-key-id: ${{ secrets.ACCESS_KEY }}
access-key-secret: ${{ secrets.SECRET_KEY }}
ossutil-version: '1.7.16'
- name: rust build
run: |
echo $PWD
cd boot-extension/rule-engine/src/main/rust
echo $PWD
rustup target add ${{ matrix.arch }}-apple-darwin
cargo build --release --target ${{ matrix.arch }}-apple-darwin
- name: Copy
run: |
cd boot-extension/rule-engine/src/main/rust
cp -f target/${{ matrix.arch }}-apple-darwin/release/libzen_engine.dylib ./resources/libzen_engine-osx-${{ matrix.arch }}.dylib
- name: Upload
run: |
cd boot-extension/rule-engine
ossutil cp ./src/main/resources/libzen_engine-osx-${{ matrix.arch }}.dylib oss://workoss/static/${{ inputs.rustChannel }}/libzen_engine-osx-${{ matrix.arch }}.dylib