Skip to content

Commit a94f574

Browse files
author
opencode
committed
Add Linux installer script that installs Ollama, model, flatpak, and tests
1 parent f0f3b82 commit a94f574

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
permissions:
100100
contents: write
101101
steps:
102+
- uses: actions/checkout@v4
102103
- name: Download artifacts
103104
uses: actions/download-artifact@v4
104105
- name: Create Release
@@ -111,5 +112,6 @@ jobs:
111112
Voice2Text-macOS/Voice2Text
112113
Voice2Text-Linux/Voice2Text
113114
Voice2Text-Flatpak/com.voice2text.app.flatpak
115+
install.sh
114116
draft: false
115117
prerelease: false

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ Download the latest release for your platform from [GitHub Releases](https://git
3535
- **Linux**: `Voice2Text` (or install via Flatpak below)
3636

3737
### Option 2: Flatpak (Linux)
38+
Download the installer script and run it:
39+
```bash
40+
wget https://github.com/crhy/Voice2Text-AI/releases/download/v0.2/install.sh
41+
chmod +x install.sh
42+
./install.sh
43+
```
44+
Or manually install the flatpak:
3845
```bash
3946
flatpak install flathub com.voice2text.app
4047
```

install.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
# Voice2Text AI Linux Installer
4+
# This script installs Ollama, pulls the required model, installs the flatpak, and tests Ollama.
5+
6+
set -e
7+
8+
echo "Voice2Text AI Linux Installer"
9+
echo "============================="
10+
11+
# Install flatpak if not installed
12+
if ! command -v flatpak &> /dev/null; then
13+
echo "Installing flatpak..."
14+
sudo apt-get update
15+
sudo apt-get install -y flatpak
16+
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
17+
fi
18+
19+
# Download and install latest Ollama
20+
echo "Downloading latest Ollama..."
21+
OLLAMA_URL=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "browser_download_url.*linux-amd64" | cut -d '"' -f 4)
22+
if [ -z "$OLLAMA_URL" ]; then
23+
echo "Failed to find Ollama download URL"
24+
exit 1
25+
fi
26+
wget -O ollama-linux-amd64.tgz "$OLLAMA_URL"
27+
tar -xzf ollama-linux-amd64.tgz
28+
sudo mv ollama /usr/local/bin/
29+
rm ollama-linux-amd64.tgz
30+
31+
# Start Ollama service (assuming systemd)
32+
echo "Starting Ollama service..."
33+
sudo useradd -r -s /bin/false ollama || true
34+
sudo mkdir -p /etc/systemd/system
35+
cat <<EOF | sudo tee /etc/systemd/system/ollama.service
36+
[Unit]
37+
Description=Ollama Service
38+
After=network-online.target
39+
40+
[Service]
41+
ExecStart=/usr/local/bin/ollama serve
42+
User=ollama
43+
Group=ollama
44+
Restart=always
45+
RestartSec=3
46+
47+
[Install]
48+
WantedBy=default.target
49+
EOF
50+
sudo systemctl daemon-reload
51+
sudo systemctl enable ollama
52+
sudo systemctl start ollama
53+
54+
# Wait for Ollama to start
55+
echo "Waiting for Ollama to start..."
56+
sleep 10
57+
58+
# Pull the model
59+
echo "Pulling qwen2.5:0.5b model..."
60+
ollama pull qwen2.5:0.5b
61+
62+
# Install the flatpak
63+
echo "Installing Voice2Text AI flatpak..."
64+
flatpak install -y --user com.voice2text.app.flatpak
65+
66+
# Test Ollama
67+
echo "Testing Ollama..."
68+
if ollama list | grep -q "qwen2.5:0.5b"; then
69+
echo "Ollama test passed: Model qwen2.5:0.5b is installed."
70+
else
71+
echo "Ollama test failed: Model not found."
72+
exit 1
73+
fi
74+
75+
echo "Installation complete! Run 'flatpak run com.voice2text.app' to start the app."

0 commit comments

Comments
 (0)