-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (58 loc) · 1.86 KB
/
build-windows-executable-app.yaml
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
name: Build executable for Windows
on: [push]
jobs:
build-executable:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Setup virtual environment
shell: cmd
run: |
python -m venv myenv
call myenv\Scripts\activate.bat
pip install -r requirements.txt
pip install pyinstaller
- name: Write function to cli.py
shell: bash
run: |
head -n -2 D:/a/umetaflow-gui/umetaflow-gui/myenv/Lib/site-packages/streamlit/web/cli.py > temp_cli.py
cat << EOF >> temp_cli.py
def _main_run_clExplicit(file, command_line, args=[], flag_options=[]):
main._is_running_with_streamlit = True
bootstrap.run(file, command_line, args, flag_options)
if __name__ == "__main__":
main()
EOF
mv temp_cli.py D:/a/umetaflow-gui/umetaflow-gui/myenv/Lib/site-packages/streamlit/web/cli.py
- name: Compile app with pyinstaller
shell: cmd
run: |
call myenv\Scripts\activate.bat
pyinstaller --onefile --additional-hooks-dir ./hooks run_app.py --clean
- name: Copy everything to dist directory
run: |
cp -r .streamlit dist/.streamlit
cp -r pages dist/pages
cp -r src dist/src
cp -r assets dist/assets
cp -r example-data dist/example-data
cp Home.py dist/
- name: Modify .spec file
shell: bash
run: |
cp run_app_temp.spec run_app.spec
- name: Make executable
shell: cmd
run: |
call myenv\Scripts\activate.bat
pyinstaller run_app.spec --clean
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: UmetaFlow-App
path: dist