1- name : 鏋勫缓鍘熺敓搴撹祫浜?
1+ name : Build Native Assets
2+
23' on ' :
34 push :
45 branches : [main, develop, master]
@@ -21,21 +22,21 @@ name: 鏋勫缓鍘熺敓搴撹祫浜?
2122 workflow_dispatch :
2223 inputs :
2324 note :
24- description : " 鍙€夊娉細鐢ㄤ簬璇存槑鏈鎵嬪姩瑙﹀彂鐨勭洰鐨?
25+ description : Optional note for this manual run
2526 required : false
2627 default : " "
2728 workflow_call :
28- # inputs: 褰撳墠宸ヤ綔娴佹棤闇€璋冪敤鏂归澶栦紶鍙傦紝鎸夌煩闃电洿鎺ユ瀯寤哄骞冲彴鍘熺敓搴撱€? # outputs: 褰撳墠宸ヤ綔娴佷粎浜у嚭 artifact锛屼笉鍚戣皟鐢ㄦ柟杩斿洖缁撴瀯鍖?outputs銆?
29+
2930jobs :
3031 build :
31- name: 鏋勫缓鍘熺敓搴擄紙${{ matrix.rid }}锛? runs-on: ${{ matrix.os }}
32+ name : Build native (${{ matrix.rid }})
33+ runs-on : ${{ matrix.os }}
3234 permissions :
3335 contents : read
3436 strategy :
3537 fail-fast : false
3638 matrix :
3739 include :
38- # Windows 鐩爣锛氶€氳繃 MSVC -A 鍙傛暟鏋勫缓澶氭灦鏋勫師鐢熷簱
3940 - rid : win-x64
4041 os : windows-latest
4142 cmake_generator : " Visual Studio 17 2022"
@@ -48,42 +49,39 @@ jobs:
4849 os : windows-latest
4950 cmake_generator : " Visual Studio 17 2022"
5051 cmake_arch : ARM64
51-
52- # Linux 鐩爣锛氬師鐢?x64锛堜笌 LVGL 瀹樻柟 CI 涓€鑷达紝浣跨敤 ubuntu-24.04锛? - rid: linux-x64
52+ - rid : linux-x64
5353 os : ubuntu-24.04
54+ apt_packages : " "
5455 cmake_extra : " "
55-
56- # Linux 鐩爣锛欰RM 浜ゅ弶缂栬瘧锛堢‖娴偣锛? - rid: linux-arm
56+ - rid : linux-arm
5757 os : ubuntu-24.04
5858 apt_packages : gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
5959 cmake_extra : >-
6060 -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/libs/cmake/toolchains/arm-linux-gnueabihf.cmake
61-
62- # Linux 鐩爣锛欰RM64 浜ゅ弶缂栬瘧
6361 - rid : linux-arm64
6462 os : ubuntu-24.04
6563 apt_packages : gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
6664 cmake_extra : >-
6765 -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/libs/cmake/toolchains/aarch64-linux-gnu.cmake
6866
6967 steps :
70- - name : 妫€鍑轰唬鐮? uses: actions/checkout@v4
68+ - name : Checkout
69+ uses : actions/checkout@v4
7170 with :
7271 submodules : recursive
7372
74- # 1. 鍑嗗 LVGL 鏋勫缓杈撳叆
75- - name : 澶嶅埗 lv_conf.h 鍒?lvgl 婧愮爜鐩綍
73+ - name : Copy lv_conf.h into the LVGL tree
7674 shell : bash
7775 run : cp libs/lv_conf.h libs/lvgl/lv_conf.h
7876
79- # 2. 瀹夎 Linux 鏋勫缓渚濊禆
80- - name : 瀹夎 Linux 鏋勫缓渚濊禆
77+ - name : Install Linux build dependencies
8178 if : runner.os == 'Linux'
8279 run : |
8380 sudo apt-get update -qq
8481 sudo apt-get install -y cmake ninja-build ${{ matrix.apt_packages }}
8582
86- # 3. 閰嶇疆骞剁紪璇?Windows 鍘熺敓搴? - name: CMake 閰嶇疆锛圵indows锛? if: runner.os == 'Windows'
83+ - name : Configure with CMake on Windows
84+ if : runner.os == 'Windows'
8785 shell : bash
8886 run : |
8987 cmake -S libs/lvgl -B libs/lvgl/build_shared \
@@ -95,11 +93,14 @@ jobs:
9593 -DBUILD_SHARED_LIBS=ON \
9694 -DCONFIG_LV_USE_PRIVATE_API=ON
9795
98- - name : 缂栬瘧锛圵indows锛? if: runner.os == 'Windows'
96+ - name : Build on Windows
97+ if : runner.os == 'Windows'
9998 shell : bash
10099 run : cmake --build libs/lvgl/build_shared --config Release
101100
102- # 4. 閰嶇疆骞剁紪璇?Linux 鍘熺敓搴? - name: CMake 閰嶇疆锛圠inux锛? if: runner.os == 'Linux'
101+ - name : Configure with CMake on Linux
102+ if : runner.os == 'Linux'
103+ shell : bash
103104 run : |
104105 cmake -S libs/lvgl -B libs/lvgl/build_shared \
105106 -G Ninja \
@@ -111,11 +112,13 @@ jobs:
111112 -DBUILD_SHARED_LIBS=ON \
112113 -DCONFIG_LV_USE_PRIVATE_API=ON
113114
114- - name : 缂栬瘧锛圠inux锛? if: runner.os == 'Linux'
115+ - name : Build on Linux
116+ if : runner.os == 'Linux'
117+ shell : bash
115118 run : cmake --build libs/lvgl/build_shared
116119
117- # 5. 鏀堕泦骞舵牎楠屽師鐢熷簱浜х墿
118- - name : 鏀堕泦鍘熺敓搴撴枃浠? shell: bash
120+ - name : Collect native binaries
121+ shell : bash
119122 run : |
120123 mkdir -p native_output
121124 find libs/lvgl/build_shared -name "lvgl.dll" | head -1 | xargs -I{} cp {} native_output/ 2>/dev/null || true
@@ -125,12 +128,13 @@ jobs:
125128 fi
126129 ls -la native_output/
127130
128- - name : 鏍¢獙瀵煎嚭绗﹀彿锛圠inux锛? if: runner.os == 'Linux'
131+ - name : Validate exported symbols on Linux
132+ if : runner.os == 'Linux'
129133 shell : bash
130134 run : |
131135 lib="native_output/liblvgl.so"
132136 if [ ! -f "$lib" ]; then
133- echo "閿欒锛氭湭鎵惧埌 $lib"
137+ echo "Error: missing $lib"
134138 exit 1
135139 fi
136140
@@ -150,20 +154,21 @@ jobs:
150154 done
151155
152156 if [ ${#missing[@]} -ne 0 ]; then
153- echo "閿欒锛?lib 缂哄皯浠ヤ笅瀵煎嚭绗﹀彿锛? {missing[*]}"
157+ echo "Error: missing exports: $ {missing[*]}"
154158 echo "===== nm -D $lib ====="
155159 nm -D "$lib" || true
156160 exit 1
157161 fi
158162
159- echo "瀵煎嚭绗﹀彿鏍¢獙閫氳繃锛? {expected_symbols[*]}"
163+ echo "Validated exports: $ {expected_symbols[*]}"
160164
161- - name : 鏍¢獙瀵煎嚭绗﹀彿锛圵indows锛? if: runner.os == 'Windows'
165+ - name : Validate exported symbols on Windows
166+ if : runner.os == 'Windows'
162167 shell : pwsh
163168 run : |
164169 $lib = Join-Path $PWD 'native_output\lvgl.dll'
165170 if (-not (Test-Path $lib)) {
166- throw "鏈壘鍒? $lib"
171+ throw "Missing $lib"
167172 }
168173
169174 $dumpbin = (Get-Command dumpbin.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source -First 1)
@@ -181,7 +186,7 @@ jobs:
181186 }
182187
183188 if (-not $dumpbin) {
184- throw '鏈壘鍒? dumpbin.exe锛屾棤娉曟牎楠? Windows 瀵煎嚭绗﹀彿銆?
189+ throw 'Missing dumpbin.exe; cannot validate Windows exports.'
185190 }
186191
187192 $exports = & $dumpbin /exports $lib 2>&1
@@ -200,35 +205,36 @@ jobs:
200205 }
201206
202207 if ($missing.Count -gt 0) {
203- Write-Host "閿欒锛?lib 缂哄皯浠ヤ笅瀵煎嚭绗﹀彿锛? ($missing -join ', ')"
208+ Write-Host "Error: missing exports: $ ($missing -join ', ')"
204209 Write-Host "===== dumpbin /exports $lib ====="
205210 $exports | ForEach-Object { Write-Host $_ }
206- throw 'Windows 瀵煎嚭绗﹀彿鏍¢獙澶辫触銆?
211+ throw 'Windows export validation failed.'
207212 }
208213
209- Write-Host "瀵煎嚭绗﹀彿鏍¢獙閫氳繃锛? ($expectedSymbols -join ', ')"
214+ Write-Host "Validated exports: $ ($expectedSymbols -join ', ')"
210215
211- - name : 鐢熸垚 sha256
216+ - name : Generate sha256 files
212217 shell : pwsh
213218 run : |
214219 $files = Get-ChildItem -Path native_output -File | Where-Object { $_.Extension -in '.dll', '.so' }
215220 if (-not $files) {
216- throw 'native_output 涓病鏈夊彲鐢熸垚鏍¢獙鍊肩殑鍘熺敓搴撴枃浠躲€?
221+ throw 'No native binaries were found in native_output.'
217222 }
218223
219224 foreach ($file in $files) {
220225 $hash = (Get-FileHash -Path $file.FullName -Algorithm SHA256).Hash.ToLowerInvariant()
221226 $shaFile = "$($file.FullName).sha256"
222227 Set-Content -Path $shaFile -Value "$hash $($file.Name)" -NoNewline
223- Write-Host "宸茬敓鎴? $shaFile"
228+ Write-Host "Generated $shaFile"
224229 }
225230
226231 Get-ChildItem -Path native_output -Filter '*.sha256' | ForEach-Object {
227232 Write-Host "===== $($_.Name) ====="
228233 Get-Content $_.FullName | ForEach-Object { Write-Host $_ }
229234 }
230235
231- - name : 涓婁紶鍘熺敓搴撳埗鍝? uses: actions/upload-artifact@v4
236+ - name : Upload native artifact
237+ uses : actions/upload-artifact@v4
232238 with :
233239 name : native-${{ matrix.rid }}
234240 path : native_output/
0 commit comments