-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (74 loc) · 2.39 KB
/
release.yml
File metadata and controls
85 lines (74 loc) · 2.39 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
name: Build and Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ${{ matrix.os }}
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
# Move binary to backend root so it's picked up by extraResources
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 }}