-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (85 loc) · 2.65 KB
/
test_streamlit_app.yaml
File metadata and controls
103 lines (85 loc) · 2.65 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
name: Test streamlit executable for Windows
on:
workflow_dispatch:
jobs:
build-executable:
runs-on: windows-latest
env:
PYTHON_VERSION: 3.11.0
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- 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: Check if myenv is activated
shell: cmd
run: |
call myenv\Scripts\activate.bat
if "%VIRTUAL_ENV%" == "" (
echo myenv is not activated
) else (
echo myenv is activated
)
- name: Debug Environment
shell: cmd
run: |
echo Current directory: %CD%
echo Path to myenv: %CD%\myenv
dir %CD%\myenv\Scripts
- name: Write function to cli.py
shell: bash
run: |
head -n -2 D:/a/nuxl-app/nuxl-app/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/nuxl-app/nuxl-app/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
shell: bash
run: |
cp -r streamlit_exe/.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 app.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: Copy artifacts
shell: bash
run: |
mkdir artifacts
cp -r dist artifacts/
cp -r build artifacts/
cp run_app.spec artifacts/
cp D:/a/nuxl-app/nuxl-app/myenv/Lib/site-packages/streamlit/web/cli.py artifacts/
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Outfolders
path: artifacts