-
Notifications
You must be signed in to change notification settings - Fork 57
226 lines (192 loc) · 7.19 KB
/
rust.yml
File metadata and controls
226 lines (192 loc) · 7.19 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: make-package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build_server_ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-25.10, ubuntu-25.04, ubuntu-24.04]
steps:
- uses: actions/checkout@v4
- name: Install stable + i686 target
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: i686-unknown-linux-gnu
- name: Install i386 deps
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y build-essential g++-multilib
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-registry-${{ runner.os }}-${{ matrix.os }}-i686-unknown-linux-gnu-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-registry-${{ runner.os }}-${{ matrix.os }}-i686-unknown-linux-gnu-
cargo-registry-${{ runner.os }}-${{ matrix.os }}-
- name: Cache target dir
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/target
key: cargo-target-${{ runner.os }}-${{ matrix.os }}-i686-unknown-linux-gnu-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-target-${{ runner.os }}-${{ matrix.os }}-i686-unknown-linux-gnu-
cargo-target-${{ runner.os }}-${{ matrix.os }}-
- name: Build server plugin
run: |
cargo build --package server --release --target i686-unknown-linux-gnu
strip -s target/i686-unknown-linux-gnu/release/libserver.so -o stripped.so
- uses: actions/upload-artifact@v4
with:
name: cef-${{ matrix.os }}.so
path: stripped.so
build_server_debian:
runs-on: ubuntu-latest
container: debian:${{ matrix.os }}
strategy:
matrix:
os: [12, 13]
steps:
- name: Install i386 deps
run: |
dpkg --add-architecture i386
apt-get update
apt-get install -y build-essential curl make g++-multilib
- name: Install stable + i686 target
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: i686-unknown-linux-gnu
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-registry-${{ runner.os }}-debian${{ matrix.os }}-i686-unknown-linux-gnu-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-registry-${{ runner.os }}-debian${{ matrix.os }}-i686-unknown-linux-gnu-
cargo-registry-${{ runner.os }}-debian${{ matrix.os }}-
- name: Cache target dir
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/target
key: cargo-target-${{ runner.os }}-debian${{ matrix.os }}-i686-unknown-linux-gnu-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-target-${{ runner.os }}-debian${{ matrix.os }}-i686-unknown-linux-gnu-
cargo-target-${{ runner.os }}-debian${{ matrix.os }}-
- name: Build server plugin
run: |
cargo build --package server --release --target i686-unknown-linux-gnu
strip -s target/i686-unknown-linux-gnu/release/libserver.so -o stripped.so
- uses: actions/upload-artifact@v4
with:
name: cef-debian-${{ matrix.os }}.so
path: stripped.so
build_client:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Configuration
run: |
Write-Output "DX_SDK_DIR=${env:TEMP}/dxsdk" >> ${env:GITHUB_ENV}
Write-Output "DX_SDK=${env:TEMP}/dxsdk/Lib/x86" >> ${env:GITHUB_ENV}
Write-Output "CEF_PATH=${env:TEMP}/cef" >> ${env:GITHUB_ENV}
- name: DirectX SDK cache
id: dx-cache
uses: actions/cache@v4
with:
path: ${{ env.DX_SDK_DIR }}
key: directx
- name: CEF static library cache
id: cef-cache
uses: actions/cache@v4
with:
path: ${{ env.CEF_PATH }}
key: libcef
- name: Install DirectX SDK
if: steps.dx-cache.outputs.cache-hit != 'true'
run: |
curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o _DX2010_.exe
7z x _DX2010_.exe DXSDK/Lib/x86 -o_DX2010_
mv _DX2010_/DXSDK $DX_SDK_DIR
rm -fR _DX*_ _DX*_.exe
shell: bash
- name: Download CEF static library
if: steps.cef-cache.outputs.cache-hit != 'true'
run: |
curl -L https://github.com/ZOTTCE/samp-cef/releases/download/v1.1-beta/libcef.lib -o libcef.lib
mkdir -p $CEF_PATH
mv libcef.lib $CEF_PATH/libcef.lib
shell: bash
- name: Install stable + i686 target (MSVC)
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: i686-pc-windows-msvc
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-registry-${{ runner.os }}-i686-pc-windows-msvc-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-registry-${{ runner.os }}-i686-pc-windows-msvc-
cargo-registry-${{ runner.os }}-
- name: Cache target dir
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/target
key: cargo-target-${{ runner.os }}-i686-pc-windows-msvc-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-target-${{ runner.os }}-i686-pc-windows-msvc-
cargo-target-${{ runner.os }}-
- name: Build client (i686)
run: cargo build --release --target i686-pc-windows-msvc
shell: bash
- name: Make a package
run: |
mkdir redist && cd redist
curl -L https://github.com/ZOTTCE/samp-cef/releases/download/v1.1-beta/cef.zip -o cef_redist.zip
7z x cef_redist.zip -ocef
cp ../target/i686-pc-windows-msvc/release/client.dll cef/client.dll
cp ../target/i686-pc-windows-msvc/release/renderer.exe cef/renderer.exe
cp ../target/i686-pc-windows-msvc/release/loader.dll cef.asi
7z a -tzip cef.zip cef.asi cef
shell: bash
- uses: actions/upload-artifact@v4
with:
name: client.dll
path: target/i686-pc-windows-msvc/release/client.dll
- uses: actions/upload-artifact@v4
with:
name: renderer.exe
path: target/i686-pc-windows-msvc/release/renderer.exe
- uses: actions/upload-artifact@v4
with:
name: cef.asi
path: target/i686-pc-windows-msvc/release/loader.dll
- uses: actions/upload-artifact@v4
with:
name: cef-windows.dll
path: target/i686-pc-windows-msvc/release/server.dll
- uses: actions/upload-artifact@v4
with:
name: cef.zip
path: redist/cef.zip