-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage-windows
More file actions
executable file
·50 lines (36 loc) · 2 KB
/
package-windows
File metadata and controls
executable file
·50 lines (36 loc) · 2 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
#!/bin/bash
set -eu
./build-python
VERSION=$(uv version --short)
# 64-bit MinGW (Windows 10+, Windows Server 2016+)
# https://doc.rust-lang.org/rustc/platform-support.html#tier-1-with-host-tools
CARGO_BUILD_TARGET=x86_64-pc-windows-gnu
BUNDLE_DIR=~/.cache/learn2rag-dist
BUNDLE_NAME=learn2rag-windows
BUNDLE=$BUNDLE_DIR/$BUNDLE_NAME
mkdir -p $BUNDLE
mkdir -p $BUNDLE/services
PYAPP_DISTRIBUTION_EMBED=true
PYAPP_FULL_ISOLATION=true
PYAPP_EXPOSE_ALL_COMMANDS=true
cp dist/learn2rag-$VERSION.tar.gz pyapp
(cd pyapp; PYAPP_PYTHON_VERSION=3.13 PYAPP_PROJECT_NAME=learn2rag PYAPP_PROJECT_PATH=learn2rag-$VERSION.tar.gz cross build --release --target $CARGO_BUILD_TARGET)
cp pyapp/target/$CARGO_BUILD_TARGET/release/pyapp.exe $BUNDLE/configurator.exe
cp services/start-import.windows.bat $BUNDLE/services/start-import.bat
cp services/open-webui/dist/open_webui-0.6.15.tar.gz pyapp
(cd pyapp; PYAPP_PYTHON_VERSION=3.11 PYAPP_PROJECT_NAME=open-webui PYAPP_PROJECT_PATH=open_webui-0.6.15.tar.gz PYAPP_EXEC_SPEC=open_webui:app cross build --release --target $CARGO_BUILD_TARGET)
cp pyapp/target/$CARGO_BUILD_TARGET/release/pyapp.exe $BUNDLE/services/start-open-webui.exe
while read -u 100 file; do
mkdir -p $BUNDLE/$(dirname $file)
cp -r $file $BUNDLE/$file
done 100<Distfiles
wget --continue -O $BUNDLE_DIR/ollama-windows.zip https://github.com/ollama/ollama/releases/download/v0.12.1/ollama-windows-amd64.zip
mkdir -p $BUNDLE/services/ollama
unzip -o $BUNDLE_DIR/ollama-windows.zip -d $BUNDLE/services/ollama
wget --continue -O $BUNDLE_DIR/qdrant-windows.zip https://github.com/qdrant/qdrant/releases/download/v1.15.4/qdrant-x86_64-pc-windows-msvc.zip
mkdir -p $BUNDLE/services/qdrant
unzip -o $BUNDLE_DIR/qdrant-windows.zip -d $BUNDLE/services/qdrant
cp start.windows.bat $BUNDLE/start.bat
cp uninstall.windows.bat $BUNDLE/uninstall.bat
# https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables
[ -z "${GITHUB_ACTIONS-}" ] && (cd $BUNDLE_DIR; zip -r $BUNDLE_NAME $BUNDLE_NAME)