77 - " build.*"
88
99jobs :
10- build_x86_64 :
11- name : Build for x86_64
10+ build_pyc :
11+ name : Build for pyc files only
1212 runs-on : ubuntu-latest
1313 steps :
1414 - name : Checkout code
@@ -23,26 +23,16 @@ jobs:
2323 with :
2424 python-version : ' 3.10'
2525
26- - name : Install build dependencies
27- run : |
28- sudo apt-get update
29- sudo apt-get install -y build-essential
30- pip install --upgrade pip setuptools wheel
31- pip install cython
32-
3326 - name : Build and Clean Artifacts
3427 working-directory : ./bisheng-telemetry-search/telemetry_search
3528 run : |
3629 # 执行构建
37- python build_all.py --delete-source
30+ python -m compileall -b .
3831
3932 # 在上传前彻底清理源代码和中间文件
4033 # 即使 build_all.py 做了清理,这里再次强制清理,防止 .c 文件泄露
41- find . -name "*.c" -delete
42- find . -name "*.cpp" -delete
34+ find . -name "*.py" -delete
4335 find . -name "__pycache__" -exec rm -rf {} +
44- rm -rf ./build
45- rm -f build_all.py setup.py # 删除构建脚本本身
4636
4737 # 准备输出
4838 mkdir ../../build_output
@@ -51,64 +41,15 @@ jobs:
5141 echo "Listing artifacts to be uploaded:"
5242 ls -R ../../build_output/
5343
54- - name : Upload x86_64 build artifacts
55- uses : actions/upload-artifact@v4
56- with :
57- name : telemetry_search-x86_64
58- path : ./build_output/*
59-
60- build_arm :
61- name : Build for ARM
62- runs-on : ubuntu-22.04-arm
63- steps :
64- - name : Checkout code
65- uses : actions/checkout@v4
66- with :
67- repository : dataelement/bisheng-telemetry-search
68- token : ${{ secrets.CROSS_REPO_TOKEN }}
69- path : bisheng-telemetry-search
70-
71- - name : Set up Python
72- uses : actions/setup-python@v5
73- with :
74- python-version : ' 3.10'
75-
76- - name : Install build dependencies
77- run : |
78- sudo apt-get update
79- sudo apt-get install -y build-essential
80- pip install --upgrade pip setuptools wheel
81- pip install cython
82-
83- - name : Build and Clean Artifacts
84- working-directory : ./bisheng-telemetry-search/telemetry_search
85- run : |
86- # 1. 执行构建
87- python build_all.py --delete-source
88-
89- # 2. [关键] 强制清理 .c / .cpp / __pycache__
90- find . -name "*.c" -delete
91- find . -name "*.cpp" -delete
92- find . -name "__pycache__" -exec rm -rf {} +
93- rm -rf ./build
94- rm -f build_all.py setup.py
95-
96- # 3. 准备输出
97- mkdir ../../build_output
98- cp -r ./* ../../build_output/
99-
100- echo "Listing artifacts to be uploaded:"
101- ls -R ../../build_output/
102-
103- - name : Upload ARM build artifacts
44+ - name : Upload PYC Artifacts
10445 uses : actions/upload-artifact@v4
10546 with :
106- name : telemetry_search-arm
47+ name : telemetry_search
10748 path : ./build_output/*
10849
10950 deploy_to_sso_project :
11051 name : Deploy Artifacts to SSO Project
111- needs : [ build_x86_64, build_arm ]
52+ needs : [ build_pyc ]
11253 runs-on : ubuntu-latest
11354 steps :
11455 - name : Checkout SSO Project
@@ -122,30 +63,16 @@ jobs:
12263 # 确保拉取完整的历史以便正确提交
12364 fetch-depth : 0
12465
125- - name : Download x86_64 build artifacts
66+ - name : Download PYC Artifacts
12667 uses : actions/download-artifact@v4
12768 with :
128- name : telemetry_search-x86_64
129- path : ./telemetry_search_x86_64
130-
131- - name : Download ARM build artifacts
132- uses : actions/download-artifact@v4
133- with :
134- name : telemetry_search-arm
135- path : ./telemetry_search_arm
69+ name : telemetry_search
70+ path : ./telemetry_search
13671
13772 - name : Merge and Place Files
13873 run : |
139- # 创建临时合并目录
140- mkdir -p ./telemetry_search
141-
142- # 先复制 x86_64 文件
143- cp -r ./telemetry_search_x86_64/* ./telemetry_search/
144-
145- # 再复制 ARM 文件 (不会覆盖 .so,因为文件名包含架构信息;会覆盖 .py,但应该是一样的)
146- cp -r ./telemetry_search_arm/* ./telemetry_search/
14774
148- find ./telemetry_search -name "*.c " -delete
75+ find ./telemetry_search -name "*.py " -delete
14976
15077 # 移动到目标仓库目录
15178 cp -r ./telemetry_search ./bisheng/src/backend/bisheng/
0 commit comments