-
Notifications
You must be signed in to change notification settings - Fork 1
169 lines (148 loc) · 4.83 KB
/
release.yml
File metadata and controls
169 lines (148 loc) · 4.83 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Build and Release
on:
push:
tags:
- "v*"
jobs:
verify-build:
name: Verify Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: './electron-app/package-lock.json'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
cd electron-app
npm config set fetch-retries 10
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000
npm ci --prefer-offline --no-audit
- name: Install Python dependencies
run: |
pip install -r backend/requirements.txt
pip install pyinstaller
- name: Build Backend with PyInstaller
run: |
cd backend
pyinstaller --onefile --noconsole \
--collect-all uvicorn \
--collect-all fastapi \
--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 \
api_server.py
if [ "${{ matrix.os }}" = "windows-latest" ]; then
mv dist/api_server.exe .
else
mv dist/api_server .
fi
shell: bash
- name: Build Frontend (Vite)
run: |
cd electron-app
npm run build
- name: Build Electron App
run: |
cd electron-app
npm run electron:build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: |
electron-app/release/**/*.exe
electron-app/release/**/*.AppImage
electron-app/release/**/*.deb
if-no-files-found: warn
release:
name: Publish Release (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: verify-build
permissions:
contents: write
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Delete existing release (if exists)
shell: bash
run: |
gh release delete ${{ github.ref_name }} --yes || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: './electron-app/package-lock.json'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
cd electron-app
npm config set fetch-retries 10
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000
npm ci --prefer-offline --no-audit
- name: Install Python dependencies
run: |
pip install -r backend/requirements.txt
pip install pyinstaller
- name: Build Backend with PyInstaller
run: |
cd backend
pyinstaller --onefile --noconsole \
--collect-all uvicorn \
--collect-all fastapi \
--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 \
api_server.py
if [ "${{ matrix.os }}" = "windows-latest" ]; then
mv dist/api_server.exe .
else
mv dist/api_server .
fi
shell: bash
- name: Build and Publish Electron
run: |
cd electron-app
npm run electron:build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}