Skip to content

Commit

Permalink
github actions - fix windows build v7
Browse files Browse the repository at this point in the history
  • Loading branch information
slatinsky committed Aug 13, 2024
1 parent c2be930 commit 1f52a9a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 25 deletions.
38 changes: 16 additions & 22 deletions src/BUILD_RELEASE.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ mkdir "_temp"
@REM install windows-runner dependencies
if not exist "_temp\dcef\venv" (
call py -m venv _temp\dcef\venv
call _temp\dcef\venv\Scripts\activate
call pip install -r requirements.txt
call deactivate
call "_temp\dcef\venv\Scripts\python.exe" -m pip install -r requirements.txt
)
@REM Build windows-runner
py -m PyInstaller --onefile --name dcef --icon "../../icon.ico" --distpath "_temp/dcef/" --specpath "_temp/dcef/" --workpath "_temp/dcef/" ./dcef.py --paths "_temp\dcef\venv\Lib\site-packages"
call "_temp\dcef\venv\Scripts\python.exe" -m PyInstaller --onefile --name dcef --icon "../../icon.ico" --distpath "_temp/dcef/" --specpath "_temp/dcef/" --workpath "_temp/dcef/" ./dcef.py
del "..\release\dcef.exe"
move "_temp\dcef\dcef.exe" "..\release\dcef.exe"

Expand All @@ -44,12 +42,10 @@ move "_temp\dcef\dcef.exe" "..\release\dcef.exe"
@REM install preprocess dependencies
if not exist "_temp\preprocess\venv" (
call py -m venv _temp\preprocess\venv
call _temp\preprocess\venv\Scripts\activate
call pip install -r dcef\backend\preprocess\requirements.txt
call deactivate
call "_temp\preprocess\venv\Scripts\python.exe" -m pip install -r dcef\backend\preprocess\requirements.txt
)
@REM Build preprocess
py -m PyInstaller --onefile --name preprocess --icon "../../icon.ico" --distpath "_temp/preprocess/" --specpath "_temp/preprocess/" --workpath "_temp/preprocess/" ./dcef/backend/preprocess/main_mongo.py --paths "_temp\preprocess\venv\Lib\site-packages"
call "_temp\preprocess\venv\Scripts\python.exe" -m PyInstaller --onefile --name preprocess --icon "../../icon.ico" --distpath "_temp/preprocess/" --specpath "_temp/preprocess/" --workpath "_temp/preprocess/" ./dcef/backend/preprocess/main_mongo.py
rmdir "..\release\dcef\backend\preprocess\" /s /q
mkdir "..\release\dcef\backend\preprocess"
move "_temp\preprocess\preprocess.exe" "..\release\dcef\backend\preprocess\dcefpreprocess.exe"
Expand All @@ -59,17 +55,15 @@ copy "dcef\backend\preprocess\emojiIndex.json" "..\release\dcef\backend\preproce
@REM install api-backend dependencies
if not exist "_temp\fastapi\venv" (
call py -m venv _temp\fastapi\venv
call _temp\fastapi\venv\Scripts\activate
call pip install -r dcef\backend\fastapi\requirements.txt
call deactivate
call "_temp\fastapi\venv\Scripts\python.exe" -m pip install -r dcef\backend\fastapi\requirements.txt
)
@REM build api-backend
py -m PyInstaller --onefile --name fastapi --icon "../../icon.ico" --distpath "_temp/fastapi/" --specpath "_temp/fastapi/" --workpath "_temp/fastapi/" ./dcef/backend/fastapi/prod.py -F --hidden-import "uvicorn.logging" --hidden-import "uvicorn.loops" --hidden-import "uvicorn.loops.auto" --hidden-import "uvicorn.protocols" --hidden-import "uvicorn.protocols.http" --hidden-import "uvicorn.protocols.http.auto" --hidden-import "uvicorn.protocols.websockets" --hidden-import "uvicorn.protocols.websockets.auto" --hidden-import "uvicorn.lifespan" --hidden-import "uvicorn.lifespan.on" --hidden-import "src.main" --paths "_temp\fastapi\venv\Lib\site-packages"
call "_temp\fastapi\venv\Scripts\python.exe" -m PyInstaller --onefile --name fastapi --icon "../../icon.ico" --distpath "_temp/fastapi/" --specpath "_temp/fastapi/" --workpath "_temp/fastapi/" ./dcef/backend/fastapi/prod.py -F --hidden-import "uvicorn.logging" --hidden-import "uvicorn.loops" --hidden-import "uvicorn.loops.auto" --hidden-import "uvicorn.protocols" --hidden-import "uvicorn.protocols.http" --hidden-import "uvicorn.protocols.http.auto" --hidden-import "uvicorn.protocols.websockets" --hidden-import "uvicorn.protocols.websockets.auto" --hidden-import "uvicorn.lifespan" --hidden-import "uvicorn.lifespan.on" --hidden-import "src.main"
rmdir "..\release\dcef\backend\fastapi\" /s /q
mkdir "..\release\dcef\backend\fastapi\"
mkdir "..\release\dcef\backend\fastapi\src\"
mkdir "..\release\dcef\backend\fastapi\src\search\"
copy "_temp\fastapi\fastapi.exe" "..\release\dcef\backend\fastapi\dceffastapi.exe"
call copy "_temp\fastapi\fastapi.exe" "..\release\dcef\backend\fastapi\dceffastapi.exe"
copy "dcef\backend\fastapi\src\search\search_categories.json" "..\release\dcef\backend\fastapi\src\search\search_categories.json" /y


Expand All @@ -81,7 +75,7 @@ cd dcef\frontend
if not exist "node_modules" (
call npm install
)
@REM build static-frontend
@REM @REM build static-frontend
call npm run build
cd ..\..
rmdir "..\release\dcef\frontend\" /s /q
Expand All @@ -91,26 +85,26 @@ move "_temp\frontend" "..\release\dcef\frontend"

@REM copy nginx
mkdir "..\release\dcef\backend\nginx\conf\"
copy "dcef\backend\nginx\conf\nginx-prod.conf" "..\release\dcef\backend\nginx\conf\nginx-prod.conf" /y
copy "dcef\backend\nginx\conf\mime.types" "..\release\dcef\backend\nginx\conf\mime.types" /y
copy "dcef\backend\nginx\dcefnginx.exe" "..\release\dcef\backend\nginx\dcefnginx.exe" /y
call copy "dcef\backend\nginx\conf\nginx-prod.conf" "..\release\dcef\backend\nginx\conf\nginx-prod.conf" /y
call copy "dcef\backend\nginx\conf\mime.types" "..\release\dcef\backend\nginx\conf\mime.types" /y
call copy "dcef\backend\nginx\dcefnginx.exe" "..\release\dcef\backend\nginx\dcefnginx.exe" /y



@REM copy mongodb
mkdir "..\release\dcef\backend\mongodb\"
mkdir "..\release\dcef\backend\mongodb\db\"
copy "dcef\backend\mongodb\dcefmongod.exe" "..\release\dcef\backend\mongodb\dcefmongod.exe" /y
copy "dcef\backend\mongodb\msvcp140.dll" "..\release\dcef\backend\mongodb\msvcp140.dll" /y
copy "dcef\backend\mongodb\vcruntime140_1.dll" "..\release\dcef\backend\mongodb\vcruntime140_1.dll" /y
call copy "dcef\backend\mongodb\dcefmongod.exe" "..\release\dcef\backend\mongodb\dcefmongod.exe" /y
call copy "dcef\backend\mongodb\msvcp140.dll" "..\release\dcef\backend\mongodb\msvcp140.dll" /y
call copy "dcef\backend\mongodb\vcruntime140_1.dll" "..\release\dcef\backend\mongodb\vcruntime140_1.dll" /y



@REM clean up files from old releases
rmdir "..\release\logs\" /s /q
mkdir "..\release\logs\"
call mkdir "..\release\logs\"
rmdir "..\release\temp\" /s /q
mkdir "..\release\temp\"
call mkdir "..\release\temp\"



Expand Down
3 changes: 2 additions & 1 deletion src/dcef/backend/configurator/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pymongo==4.3.3
pymongo==4.3.3
pyinstaller==6.10.0
3 changes: 2 additions & 1 deletion src/dcef/backend/fastapi/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
fastapi[all]==0.112.0
pymongo==4.3.3
python-dateutil==2.8.2
uvicorn==0.30.5
uvicorn==0.30.5
pyinstaller==6.10.0
1 change: 1 addition & 0 deletions src/dcef/backend/preprocess/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ requests==2.26.0
pymongo==4.3.3
colorthief==0.2.1
ijson==3.2.3
pyinstaller==6.10.0
3 changes: 2 additions & 1 deletion src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pywebview==4.0.1
pywin32==306
psutil==5.9.4
psutil==5.9.4
pyinstaller==6.10.0

0 comments on commit 1f52a9a

Please sign in to comment.