66 - production
77
88jobs :
9- build :
10- runs-on : ubuntu-latest
119
10+ # ============================================================
11+ # 1. Frontend Build
12+ # ============================================================
13+ react-build :
14+ runs-on : ubuntu-latest
15+ defaults :
16+ run :
17+ working-directory : DashAI/front
1218 steps :
13- - name : Checkout code
14- uses : actions/checkout@v4
15-
16- - name : Set up Node.js
19+ - uses : actions/checkout@v4
20+ - name : Enable Corepack and use Yarn 3
21+ run : corepack enable
22+ - name : Use Node.js
1723 uses : actions/setup-node@v4
1824 with :
19- node-version : ' 18'
25+ node-version : ' 18.x'
26+ cache : ' yarn'
27+ cache-dependency-path : DashAI/front/yarn.lock
28+ - name : Install and build
29+ run : |
30+ yarn install --frozen-lockfile
31+ yarn build
32+ - name : Upload build artifact
33+ uses : actions/upload-artifact@v4
34+ with :
35+ name : react-build
36+ path : DashAI/front/build
37+ retention-days : 1
38+ - name : Run frontend tests
39+ run : yarn test --passWithNoTests
2040
21- - name : Install frontend dependencies
22- run : yarn install
23- working-directory : DashAI/front
41+ # ============================================================
42+ # 2. Publish to PyPI
43+ # ============================================================
44+ publish-pypi :
45+ needs : react-build
46+ runs-on : ubuntu-latest
2447
25- - name : Build frontend
26- run : yarn build
27- working-directory : DashAI/front
48+ steps :
49+ - name : Checkout code
50+ uses : actions/checkout@v4
2851
2952 - name : Set up Python
3053 uses : actions/setup-python@v5
4265 - name : Verify frontend is included in wheel
4366 run : |
4467 if ! zipinfo dist/*.whl | grep -q 'DashAI/front/build'; then
45- echo "❌ Archivos del frontend no encontrados en el wheel"
68+ echo "Frontend files not found in the wheel package! "
4669 exit 1
4770 fi
4871
@@ -51,3 +74,154 @@ jobs:
5174 TWINE_USERNAME : __token__
5275 TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
5376 run : twine upload dist/*
77+
78+ # ============================================================
79+ # 3. Build Windows Executable
80+ # ============================================================
81+ build-windows-executable :
82+ needs : react-build
83+ runs-on : windows-latest
84+
85+ steps :
86+ - uses : actions/checkout@v4
87+ - name : Download React build artifact
88+ uses : actions/download-artifact@v4
89+ with :
90+ name : react-build
91+ path : DashAI/front/build
92+ - name : Set up Python 3.12
93+ uses : actions/setup-python@v5
94+ with :
95+ python-version : " 3.12"
96+ - name : Install dependencies (CPU-only)
97+ run : |
98+ python -m pip install --upgrade pip
99+ pip install -r requirements-cpu.txt
100+ pip install pyinstaller
101+ - name : Build executable
102+ shell : cmd
103+ run : |
104+ for /f "delims=" %%i in ('python -c "import site; s=site.getsitepackages(); print(s[-1])"') do set SITEPKG=%%i
105+ echo SITEPKG=%SITEPKG%
106+ if exist "%SITEPKG%\llama_cpp\lib" (
107+ echo Found llama_cpp/lib — adding binaries
108+ pyinstaller -F -n DashAI-launcher-cpu --clean ^
109+ --add-data "DashAI/front/build;DashAI/front/build" ^
110+ --add-data "%SITEPKG%\transformers;transformers" ^
111+ --add-binary "%SITEPKG%\llama_cpp\lib\*;llama_cpp/lib" ^
112+ --additional-hooks-dir=hooks DashAI/__main__.py
113+ ) else (
114+ echo No llama_cpp/lib — building without binaries
115+ pyinstaller -F -n DashAI-launcher-cpu --clean ^
116+ --add-data "DashAI/front/build;DashAI/front/build" ^
117+ --add-data "%SITEPKG%\transformers;transformers" ^
118+ --additional-hooks-dir=hooks DashAI/__main__.py
119+ )
120+ - name : Upload Windows executable
121+ uses : actions/upload-artifact@v4
122+ with :
123+ name : DashAI-windows-cpu
124+ path : dist/DashAI-launcher-cpu.exe
125+ retention-days : 1
126+
127+ # ============================================================
128+ # 4. Build macOS ARM64 Executable
129+ # ============================================================
130+ build-macos-arm64 :
131+ needs : react-build
132+ runs-on : macos-14
133+ steps :
134+ - uses : actions/checkout@v4
135+ - name : Download React build artifact
136+ uses : actions/download-artifact@v4
137+ with :
138+ name : react-build
139+ path : DashAI/front/build
140+ - uses : actions/setup-python@v5
141+ with :
142+ python-version : " 3.12"
143+ - name : Install dependencies (CPU-only)
144+ run : |
145+ python -m pip install --upgrade pip
146+ pip install -r requirements-cpu.txt
147+ pip install pyinstaller
148+ pip install --force-reinstall llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
149+ - name : Build ARM64 executable
150+ run : |
151+ SITEPKG=$(python -c "import site; print(site.getsitepackages()[-1])")
152+ echo "SITEPKG=$SITEPKG"
153+ if [ -d "$SITEPKG/llama_cpp/lib" ]; then
154+ echo "Found llama_cpp/lib — adding binaries"
155+ pyinstaller -F -n DashAI-launcher-cpu-arm64 --clean \
156+ --add-data "DashAI/front/build:DashAI/front/build" \
157+ --add-data "$SITEPKG/transformers:transformers" \
158+ --add-binary "$SITEPKG/llama_cpp/lib/*:llama_cpp/lib" \
159+ --additional-hooks-dir=hooks DashAI/__main__.py
160+ else
161+ echo "No llama_cpp/lib — building without binaries"
162+ pyinstaller -F -n DashAI-launcher-cpu-arm64 --clean \
163+ --add-data "DashAI/front/build:DashAI/front/build" \
164+ --add-data "$SITEPKG/transformers:transformers" \
165+ --additional-hooks-dir=hooks DashAI/__main__.py
166+ fi
167+ - name : Sign ARM64 binary (ad-hoc)
168+ run : |
169+ chmod +x dist/DashAI-launcher-cpu-arm64
170+ codesign --force --deep --sign - dist/DashAI-launcher-cpu-arm64
171+ - name : Upload ARM64 executable
172+ uses : actions/upload-artifact@v4
173+ with :
174+ name : DashAI-macos-arm64
175+ path : dist/DashAI-launcher-cpu-arm64
176+ retention-days : 1
177+
178+ # ============================================================
179+ # 5. Build macOS x86_64 Executable
180+ # ============================================================
181+ build-macos-x86_64 :
182+ needs : react-build
183+ runs-on : macos-15-intel
184+ steps :
185+ - uses : actions/checkout@v4
186+ - name : Download React build artifact
187+ uses : actions/download-artifact@v4
188+ with :
189+ name : react-build
190+ path : DashAI/front/build
191+ - uses : actions/setup-python@v5
192+ with :
193+ python-version : " 3.12"
194+ - name : Install dependencies (CPU-only)
195+ run : |
196+ python -m pip install --upgrade pip
197+ pip install -r requirements-cpu.txt
198+ pip install pyinstaller
199+ pip install --force-reinstall llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
200+ - name : Build x86_64 executable
201+ run : |
202+ SITEPKG=$(python -c "import site; print(site.getsitepackages()[-1])")
203+ echo "SITEPKG=$SITEPKG"
204+ if [ -d "$SITEPKG/llama_cpp/lib" ]; then
205+ echo "Found llama_cpp/lib — adding binaries"
206+ pyinstaller -F -n DashAI-launcher-cpu-x86_64 --clean \
207+ --add-data "DashAI/front/build:DashAI/front/build" \
208+ --add-data "$SITEPKG/transformers:transformers" \
209+ --add-binary "$SITEPKG/llama_cpp/lib/*:llama_cpp/lib" \
210+ --additional-hooks-dir=hooks DashAI/__main__.py
211+ else
212+ echo "No llama_cpp/lib — building without binaries"
213+ pyinstaller -F -n DashAI-launcher-cpu-x86_64 --clean \
214+ --add-data "DashAI/front/build:DashAI/front/build" \
215+ --add-data "$SITEPKG/transformers:transformers" \
216+ --additional-hooks-dir=hooks DashAI/__main__.py
217+ fi
218+ - name : Sign x86_64 binary (ad-hoc)
219+ run : |
220+ chmod +x dist/DashAI-launcher-cpu-x86_64
221+ codesign --force --deep --sign - dist/DashAI-launcher-cpu-x86_64
222+ - name : Upload x86_64 executable
223+ uses : actions/upload-artifact@v4
224+ with :
225+ name : DashAI-macos-x86_64
226+ path : dist/DashAI-launcher-cpu-x86_64
227+ retention-days : 1
0 commit comments