2026-03-21 21:09:49 -03:00
|
|
|
name: BotServer CI/CD
|
2025-12-16 13:25:26 -03:00
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
2026-04-18 16:11:27 -03:00
|
|
|
branches: [ main ]
|
|
|
|
|
pull_request:
|
|
|
|
|
branches: [ main ]
|
2025-12-16 13:25:26 -03:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
2026-04-18 16:11:27 -03:00
|
|
|
runs-on: gbo:host
|
2025-12-16 13:25:26 -03:00
|
|
|
steps:
|
2026-04-18 16:11:27 -03:00
|
|
|
- name: Pull and Build (Debug)
|
2026-04-17 18:24:55 -03:00
|
|
|
run: |
|
2026-04-18 16:11:27 -03:00
|
|
|
echo "=== Iniciando Pull and Build (Debug Rápido) ==="
|
2026-04-17 18:47:01 -03:00
|
|
|
|
2026-04-18 16:11:27 -03:00
|
|
|
# 1. Navegar para o diretório fixo
|
2026-04-18 16:07:29 -03:00
|
|
|
cd /opt/gbo/work/botserver/src
|
2026-04-17 18:47:01 -03:00
|
|
|
|
2026-04-18 16:11:27 -03:00
|
|
|
# 2. Atualizar o código
|
|
|
|
|
git pull origin main
|
2026-04-17 19:45:18 -03:00
|
|
|
|
2026-04-18 16:11:27 -03:00
|
|
|
# 3. Atualizar submódulo botlib
|
|
|
|
|
cd ../botlib && git pull && cd ..
|
2026-04-17 19:45:18 -03:00
|
|
|
|
2026-04-18 16:11:27 -03:00
|
|
|
# 4. Preparar Cargo.toml (limpar workspace members indesejados)
|
|
|
|
|
# Isso garante que apenas botserver e botlib sejam compilados
|
|
|
|
|
cp Cargo.toml Cargo.toml.bak
|
|
|
|
|
grep -v '"botapp\|"botdevice\|"bottest\|"botui\|"botbook\|"botmodels\|"botplugin\|"bottemplates"' Cargo.toml > Cargo.toml.tmp
|
|
|
|
|
mv Cargo.toml.tmp Cargo.toml
|
2026-04-17 18:47:01 -03:00
|
|
|
|
2026-04-18 16:11:27 -03:00
|
|
|
# 5. BUILD RÁPIDO (Debug mode - sem otimizações, compila mais rápido)
|
|
|
|
|
cargo build
|
2026-04-17 18:47:01 -03:00
|
|
|
|
2026-04-18 16:11:27 -03:00
|
|
|
# O binário estará em: target/debug/botserver
|
2026-04-17 18:37:22 -03:00
|
|
|
|
2026-04-18 16:11:27 -03:00
|
|
|
echo "=== Build Debug Concluído ==="
|