-
Notifications
You must be signed in to change notification settings - Fork 25
123 lines (103 loc) · 4.97 KB
/
windows-build.yml
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
name: Build Windows binaries
on:
push:
paths-ignore:
- '**.md'
branches:
- main
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2.3.3
with:
python-version: '3.11.0'
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.17.1
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
- name: Create directories
run: |
mkdir -p build\exports
mkdir -p build\registry_tweaks
mkdir -p build\dcef\backend\preprocess
mkdir -p build\dcef\backend\nginx\conf
mkdir -p build\dcef\backend\nginx\logs
mkdir -p build\dcef\backend\nginx\temp
mkdir -p build\dcef\backend\fastapi
mkdir -p build\dcef\backend\http-server
mkdir -p build\dcef\backend\mongodb
mkdir -p build\dcef\backend\mongodb\db
- name: Install pkg
run: npm install -g pkg
- name: Install frontend dependencies
working-directory: frontend
run: npm install
- name: Build frontend
working-directory: frontend
run: npm run build
- name: Install backend dependencies
working-directory: backend/preprocess
run: |
pip install -r requirements.txt
pip install pyinstaller==5.5
- name: Install configurator dependencies
working-directory: backend/configurator
run: |
pip install -r requirements.txt
- name: Install fastapi dependencies
working-directory: backend/fastapi
run: |
pip install -r requirements.txt
pip install uvicorn==0.20.0
- name: Install windows-runner dependencies
working-directory: backend/windows-runner
run: |
pip install -r requirements.txt
- name: Build preprocess executable with pyinstaller
working-directory: backend/preprocess
run: pyinstaller --onefile --name preprocess main_mongo.py
- name: Build fastapi executable with pyinstaller
working-directory: backend/fastapi
run: pyinstaller --onefile --name fastapi main.py --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 "app"
- name: Build windows-runner executable with pyinstaller
working-directory: backend/windows-runner
run: pyinstaller --onefile --name dcef windows-runner.py --icon=icon.ico
- name: Build configurator executable with pyinstaller
working-directory: backend/configurator
run: pyinstaller --onefile --name configurator main.py
- name: Install http-server
working-directory: backend/http-server
run: npm install
- name: Create executable for http-server
working-directory: backend/http-server
run: pkg node_modules/http-server/bin/http-server --target node16-win-x64
- name: Move files to build folder
run: |
mv frontend\build build\dcef\frontend
mv backend\preprocess\dist\preprocess.exe build\dcef\backend\preprocess\preprocess.exe
mv backend\fastapi\dist\fastapi.exe build\dcef\backend\fastapi\fastapi.exe
cp backend\preprocess\emojiIndex.json build\dcef\backend\preprocess\emojiIndex.json
cp backend\nginx\nginx.exe build\dcef\backend\nginx\nginx.exe
cp backend\nginx\conf\nginx-prod.conf build\dcef\backend\nginx\conf\nginx-prod.conf
cp backend\nginx\conf\mime.types build\dcef\backend\nginx\conf\mime.types
cp backend\mongodb\mongod.exe build\dcef\backend\mongodb\mongod.exe
cp backend\mongodb\vcruntime140_1.dll build\dcef\backend\mongodb\vcruntime140_1.dll
cp backend\mongodb\msvcp140.dll build\dcef\backend\mongodb\msvcp140.dll
cp backend\http-server\http-server.exe build\dcef\backend\http-server\http-server.exe
cp backend\windows-runner\dist\dcef.exe build\dcef.exe
cp backend\configurator\dist\configurator.exe build\configurator.exe
Copy-Item -Path release\exports\* -Destination build\exports -Recurse
cp release\registry_tweaks\change_260_character_path_limit_to_32767.reg build\registry_tweaks\change_260_character_path_limit_to_32767.reg
cp release\registry_tweaks\restore_260_character_path_limit.reg build\registry_tweaks\restore_260_character_path_limit.reg
cp release\registry_tweaks\README.txt build\registry_tweaks\README.txt
- name: Upload build folder
uses: actions/upload-artifact@v2
with:
name: windows-build
path: build