Skip to content

Commit 7fae49e

Browse files
committed
feat: Add scripts for packaging DEB and AppImage for SendLog Syslog
1 parent ffadec0 commit 7fae49e

4 files changed

Lines changed: 506 additions & 19 deletions

File tree

.github/workflows/release.yml

Lines changed: 89 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ jobs:
200200
libwebkit2gtk-4.1-dev \
201201
build-essential \
202202
pkg-config \
203-
libappindicator3-dev
203+
libappindicator3-dev \
204+
imagemagick \
205+
wget \
206+
file
204207
205208
- name: Setup Go
206209
uses: actions/setup-go@v5
@@ -240,8 +243,28 @@ jobs:
240243
- name: Prepare artifact (Unix)
241244
if: runner.os != 'Windows' && !matrix.is_app_bundle
242245
run: |
243-
mv "build/bin/${{ matrix.artifact }}" "build/bin/${{ matrix.output }}"
246+
cp "build/bin/${{ matrix.artifact }}" "build/bin/${{ matrix.output }}"
244247
chmod +x "build/bin/${{ matrix.output }}"
248+
249+
# Linux: Crear paquetes DEB y AppImage
250+
- name: Create Linux packages
251+
if: runner.os == 'Linux'
252+
run: |
253+
VERSION="${{ needs.prepare.outputs.version_short }}"
254+
255+
# Crear paquete DEB
256+
echo "📦 Creating DEB package..."
257+
chmod +x ./scripts/package-deb.sh
258+
./scripts/package-deb.sh "$VERSION"
259+
260+
# Crear AppImage
261+
echo "📦 Creating AppImage..."
262+
chmod +x ./scripts/package-appimage.sh
263+
./scripts/package-appimage.sh "$VERSION"
264+
265+
# Listar artefactos generados
266+
echo "📋 Generated packages:"
267+
ls -la build/bin/
245268
246269
- name: Prepare artifact (Windows)
247270
if: runner.os == 'Windows'
@@ -263,8 +286,17 @@ jobs:
263286
if: runner.os != 'Windows' && !matrix.is_app_bundle
264287
run: |
265288
cd build/bin
289+
# Checksum del binario
266290
sha256sum "${{ matrix.output }}" > "${{ matrix.output }}.sha256"
267291
292+
# Checksums de paquetes Linux
293+
if [ -f "*.deb" ]; then
294+
for f in *.deb; do sha256sum "$f" > "$f.sha256"; done
295+
fi
296+
if [ -f "*.AppImage" ]; then
297+
for f in *.AppImage; do sha256sum "$f" > "$f.sha256"; done
298+
fi
299+
268300
- name: Generate checksum (Windows)
269301
if: runner.os == 'Windows'
270302
shell: pwsh
@@ -287,6 +319,10 @@ jobs:
287319
path: |
288320
build/bin/${{ matrix.output }}
289321
build/bin/${{ matrix.output }}.sha256
322+
build/bin/*.deb
323+
build/bin/*.deb.sha256
324+
build/bin/*.AppImage
325+
build/bin/*.AppImage.sha256
290326
build/${{ matrix.output }}.zip
291327
build/${{ matrix.output }}.zip.sha256
292328
retention-days: 5
@@ -317,7 +353,7 @@ jobs:
317353
- name: Prepare release files
318354
run: |
319355
mkdir -p release
320-
find ./artifacts -type f \( -name "*.exe" -o -name "Sendlog-Syslog-linux-*" -o -name "*.zip" -o -name "*.sha256" \) -exec cp {} release/ \;
356+
find ./artifacts -type f \( -name "*.exe" -o -name "Sendlog-Syslog-linux-*" -o -name "*.deb" -o -name "*.AppImage" -o -name "*.zip" -o -name "*.sha256" \) -exec cp {} release/ \;
321357
echo "📦 Release files:"
322358
ls -la release/
323359
@@ -335,11 +371,22 @@ jobs:
335371
336372
## 📥 Downloads
337373
338-
| Platform | File | Checksum |
339-
|----------|------|----------|
340-
| **Windows** (64-bit) | `Sendlog-Syslog-windows-amd64.exe` | `.sha256` |
341-
| **Linux** (64-bit) | `Sendlog-Syslog-linux-amd64` | `.sha256` |
342-
| **macOS** (Universal) | `Sendlog-Syslog-macos-universal.app.zip` | `.sha256` |
374+
### 🪟 Windows
375+
| File | Description |
376+
|------|-------------|
377+
| `Sendlog-Syslog-windows-amd64.exe` | Windows 64-bit executable |
378+
379+
### 🐧 Linux
380+
| File | Description |
381+
|------|-------------|
382+
| `sendlog-syslog_*.deb` | **Recommended** - Debian/Ubuntu package (auto-installs dependencies) |
383+
| `Sendlog-Syslog-*-x86_64.AppImage` | Portable AppImage (no installation needed) |
384+
| `Sendlog-Syslog-linux-amd64` | Raw binary (requires manual dependency installation) |
385+
386+
### 🍎 macOS
387+
| File | Description |
388+
|------|-------------|
389+
| `Sendlog-Syslog-macos-universal.app.zip` | macOS Universal (Intel + Apple Silicon) |
343390
344391
## 🔄 Changelog
345392
@@ -348,29 +395,56 @@ jobs:
348395
## 📋 Installation
349396
350397
<details>
351-
<summary><b>Windows</b></summary>
398+
<summary><b>🪟 Windows</b></summary>
352399
353400
1. Download `Sendlog-Syslog-windows-amd64.exe`
354401
2. Run the executable
355402
</details>
356403
357404
<details>
358-
<summary><b>Linux</b></summary>
405+
<summary><b>🐧 Linux - DEB Package (Recommended)</b></summary>
359406
360407
```bash
361-
# Download and make executable
362-
chmod +x Sendlog-Syslog-linux-amd64
408+
# Download the .deb file, then:
409+
sudo apt install ./sendlog-syslog_*.deb
410+
411+
# Dependencies are installed automatically!
412+
# Run from applications menu or:
413+
sendlog-syslog
414+
```
415+
</details>
416+
417+
<details>
418+
<summary><b>🐧 Linux - AppImage (Portable)</b></summary>
419+
420+
```bash
421+
# Download the AppImage, then:
422+
chmod +x Sendlog-Syslog-*-x86_64.AppImage
423+
./Sendlog-Syslog-*-x86_64.AppImage
424+
425+
# No installation or dependencies needed!
426+
```
427+
</details>
428+
429+
<details>
430+
<summary><b>🐧 Linux - Raw Binary</b></summary>
363431
364-
# Install runtime dependencies (Ubuntu 24.04+)
432+
```bash
433+
# Install dependencies first:
434+
# Ubuntu 24.04+
365435
sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0
366436
367-
# Run
437+
# Ubuntu 22.04 and earlier
438+
sudo apt install libgtk-3-0 libwebkit2gtk-4.0-37
439+
440+
# Then run:
441+
chmod +x Sendlog-Syslog-linux-amd64
368442
./Sendlog-Syslog-linux-amd64
369443
```
370444
</details>
371445
372446
<details>
373-
<summary><b>macOS</b></summary>
447+
<summary><b>🍎 macOS</b></summary>
374448
375449
1. Download and unzip `Sendlog-Syslog-macos-universal.app.zip`
376450
2. Move `Sendlog-Syslog.app` to Applications

README.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# SendLog Syslog
22

3+
[![CI](https://github.com/yllada/Send-Log-TCP/actions/workflows/ci.yml/badge.svg)](https://github.com/yllada/Send-Log-TCP/actions/workflows/ci.yml)
4+
[![Release](https://github.com/yllada/Send-Log-TCP/actions/workflows/release.yml/badge.svg)](https://github.com/yllada/Send-Log-TCP/actions/workflows/release.yml)
5+
[![Security](https://github.com/yllada/Send-Log-TCP/actions/workflows/security.yml/badge.svg)](https://github.com/yllada/Send-Log-TCP/actions/workflows/security.yml)
6+
[![License](https://img.shields.io/github/license/yllada/Send-Log-TCP)](LICENSE)
7+
[![GitHub release](https://img.shields.io/github/v/release/yllada/Send-Log-TCP)](https://github.com/yllada/Send-Log-TCP/releases/latest)
8+
39
A modern desktop application built with **Wails v2** for sending syslog messages to remote servers via TCP or UDP protocols.
410

511
## 🚀 Features
@@ -46,19 +52,60 @@ The application features a clean, card-based interface with:
4652
- **React Hook Form** - Form management
4753
- **Zod** - Schema validation
4854

49-
## 📦 Installation
55+
## � Download
56+
57+
Pre-built binaries are available in the [Releases](https://github.com/yllada/Send-Log-TCP/releases) page.
58+
59+
### Windows
60+
Download `Sendlog-Syslog-windows-amd64.exe` and run it directly.
61+
62+
### macOS
63+
Download the appropriate version:
64+
- **Apple Silicon (M1/M2/M3):** `Sendlog-Syslog-darwin-arm64`
65+
- **Intel:** `Sendlog-Syslog-darwin-amd64`
66+
67+
### Linux
68+
69+
**Option 1: DEB Package (Recommended for Debian/Ubuntu)**
70+
```bash
71+
# Download and install - automatically handles dependencies
72+
sudo dpkg -i sendlog-syslog_*_amd64.deb
73+
sudo apt-get install -f # Install missing dependencies if any
74+
```
75+
76+
**Option 2: AppImage (Portable, no installation required)**
77+
```bash
78+
chmod +x Sendlog-Syslog-*-x86_64.AppImage
79+
./Sendlog-Syslog-*-x86_64.AppImage
80+
```
81+
82+
**Option 3: Raw Binary**
83+
```bash
84+
# Install dependencies first
85+
sudo apt install -y libgtk-3-0 libwebkit2gtk-4.1-0 # Ubuntu 24.04+
86+
# or
87+
sudo apt install -y libgtk-3-0 libwebkit2gtk-4.0-37 # Ubuntu 22.04
88+
89+
# Then run the binary
90+
chmod +x Sendlog-Syslog-linux-amd64
91+
./Sendlog-Syslog-linux-amd64
92+
```
93+
94+
---
95+
96+
## 🛠️ Development Setup
5097

5198
### Prerequisites
5299
- Go 1.21+
53100
- Node.js 18+
54101
- pnpm
55102

56-
### Linux (Ubuntu/Debian) Dependencies
103+
### Linux (Ubuntu/Debian) Build Dependencies
57104
```bash
58105
# Ubuntu 24.04+
59106
sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
60107

61-
# Ubuntu 22.04 y anteriores
108+
# Ubuntu 22.04 and earlier
62109
sudo apt install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
63110
```
64111

@@ -67,7 +114,7 @@ Or use the automated script (auto-detects version):
67114
./scripts/install-linux-deps.sh
68115
```
69116

70-
### Setup
117+
### Clone and Setup
71118

72119
1. Clone the repository:
73120
```bash

scripts/package-appimage.sh

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
#!/bin/bash
2+
# =============================================================================
3+
# Script para crear AppImage de SendLog Syslog
4+
# =============================================================================
5+
# AppImage es un formato de distribución que empaqueta la aplicación con
6+
# todas sus dependencias, permitiendo ejecutarla en cualquier distribución
7+
# Linux sin instalación.
8+
#
9+
# Requisitos:
10+
# - appimagetool (se descarga automáticamente)
11+
# - La app ya compilada en build/bin/
12+
#
13+
# Uso:
14+
# ./scripts/package-appimage.sh
15+
#
16+
# Documentación: https://appimage.org/
17+
# =============================================================================
18+
19+
set -e
20+
21+
APP_NAME="Sendlog-Syslog"
22+
APP_VERSION="${1:-1.0.0}"
23+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
24+
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
25+
BUILD_DIR="$PROJECT_DIR/build"
26+
APPDIR="$BUILD_DIR/AppDir"
27+
OUTPUT_DIR="$BUILD_DIR/bin"
28+
29+
echo "📦 Creando AppImage para $APP_NAME v$APP_VERSION"
30+
31+
# Verificar que existe el binario
32+
if [ ! -f "$OUTPUT_DIR/$APP_NAME" ] && [ ! -f "$OUTPUT_DIR/Sendlog-Syslog" ]; then
33+
echo "❌ Error: No se encontró el binario. Ejecuta 'wails build' primero."
34+
exit 1
35+
fi
36+
37+
BINARY_PATH="$OUTPUT_DIR/Sendlog-Syslog"
38+
if [ -f "$OUTPUT_DIR/$APP_NAME" ]; then
39+
BINARY_PATH="$OUTPUT_DIR/$APP_NAME"
40+
fi
41+
42+
# Limpiar AppDir anterior
43+
rm -rf "$APPDIR"
44+
mkdir -p "$APPDIR/usr/bin"
45+
mkdir -p "$APPDIR/usr/share/applications"
46+
mkdir -p "$APPDIR/usr/share/icons/hicolor/256x256/apps"
47+
mkdir -p "$APPDIR/usr/share/icons/hicolor/128x128/apps"
48+
mkdir -p "$APPDIR/usr/share/icons/hicolor/64x64/apps"
49+
mkdir -p "$APPDIR/usr/share/icons/hicolor/48x48/apps"
50+
mkdir -p "$APPDIR/usr/share/icons/hicolor/32x32/apps"
51+
52+
# Copiar binario
53+
echo "📋 Copiando binario..."
54+
cp "$BINARY_PATH" "$APPDIR/usr/bin/sendlog-syslog"
55+
chmod +x "$APPDIR/usr/bin/sendlog-syslog"
56+
57+
# Copiar icono (usar el de build si existe, o crear uno placeholder)
58+
ICON_SOURCE="$BUILD_DIR/appicon.png"
59+
if [ -f "$ICON_SOURCE" ]; then
60+
echo "🎨 Copiando iconos..."
61+
cp "$ICON_SOURCE" "$APPDIR/usr/share/icons/hicolor/256x256/apps/sendlog-syslog.png"
62+
cp "$ICON_SOURCE" "$APPDIR/sendlog-syslog.png"
63+
64+
# Crear versiones de diferentes tamaños si imagemagick está disponible
65+
if command -v convert &> /dev/null; then
66+
convert "$ICON_SOURCE" -resize 128x128 "$APPDIR/usr/share/icons/hicolor/128x128/apps/sendlog-syslog.png"
67+
convert "$ICON_SOURCE" -resize 64x64 "$APPDIR/usr/share/icons/hicolor/64x64/apps/sendlog-syslog.png"
68+
convert "$ICON_SOURCE" -resize 48x48 "$APPDIR/usr/share/icons/hicolor/48x48/apps/sendlog-syslog.png"
69+
convert "$ICON_SOURCE" -resize 32x32 "$APPDIR/usr/share/icons/hicolor/32x32/apps/sendlog-syslog.png"
70+
fi
71+
else
72+
echo "⚠️ No se encontró icono en $ICON_SOURCE"
73+
fi
74+
75+
# Crear archivo .desktop
76+
echo "📝 Creando archivo .desktop..."
77+
cat > "$APPDIR/sendlog-syslog.desktop" << EOF
78+
[Desktop Entry]
79+
Type=Application
80+
Name=SendLog Syslog
81+
Comment=Professional syslog message sender for network testing and monitoring
82+
Exec=sendlog-syslog
83+
Icon=sendlog-syslog
84+
Categories=Network;Utility;Development;
85+
Keywords=syslog;log;network;tcp;udp;monitoring;
86+
Terminal=false
87+
StartupNotify=true
88+
StartupWMClass=sendlog-syslog
89+
EOF
90+
91+
# Copiar .desktop también a usr/share/applications
92+
cp "$APPDIR/sendlog-syslog.desktop" "$APPDIR/usr/share/applications/"
93+
94+
# Crear AppRun script
95+
echo "🔧 Creando AppRun..."
96+
cat > "$APPDIR/AppRun" << 'EOF'
97+
#!/bin/bash
98+
# AppRun script para SendLog Syslog
99+
# Este script configura el entorno y ejecuta la aplicación
100+
101+
SELF=$(readlink -f "$0")
102+
HERE=${SELF%/*}
103+
104+
# Configurar variables de entorno para GTK/WebKit
105+
export PATH="${HERE}/usr/bin:${PATH}"
106+
export LD_LIBRARY_PATH="${HERE}/usr/lib:${HERE}/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}"
107+
export XDG_DATA_DIRS="${HERE}/usr/share:${XDG_DATA_DIRS}"
108+
export GTK_PATH="${HERE}/usr/lib/gtk-3.0"
109+
export GDK_PIXBUF_MODULE_FILE="${HERE}/usr/lib/gdk-pixbuf-2.0/loaders.cache"
110+
export GDK_PIXBUF_MODULEDIR="${HERE}/usr/lib/gdk-pixbuf-2.0/loaders"
111+
112+
# Ejecutar la aplicación
113+
exec "${HERE}/usr/bin/sendlog-syslog" "$@"
114+
EOF
115+
chmod +x "$APPDIR/AppRun"
116+
117+
# Descargar appimagetool si no existe
118+
APPIMAGETOOL="$BUILD_DIR/appimagetool-x86_64.AppImage"
119+
if [ ! -f "$APPIMAGETOOL" ]; then
120+
echo "📥 Descargando appimagetool..."
121+
wget -q -O "$APPIMAGETOOL" "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
122+
chmod +x "$APPIMAGETOOL"
123+
fi
124+
125+
# Crear AppImage
126+
echo "🔨 Creando AppImage..."
127+
ARCH=x86_64 "$APPIMAGETOOL" "$APPDIR" "$OUTPUT_DIR/${APP_NAME}-${APP_VERSION}-x86_64.AppImage"
128+
129+
# Limpiar
130+
rm -rf "$APPDIR"
131+
132+
echo ""
133+
echo "✅ AppImage creado exitosamente:"
134+
echo " $OUTPUT_DIR/${APP_NAME}-${APP_VERSION}-x86_64.AppImage"
135+
echo ""
136+
echo "📋 Para ejecutar:"
137+
echo " chmod +x ${APP_NAME}-${APP_VERSION}-x86_64.AppImage"
138+
echo " ./${APP_NAME}-${APP_VERSION}-x86_64.AppImage"

0 commit comments

Comments
 (0)