Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Desktop e releases

on:
pull_request:
branches: [main]
push:
branches: [main]
tags: ['v*']
workflow_dispatch:

permissions:
contents: read

concurrency:
group: desktop-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}

jobs:
build:
name: Desktop (${{ matrix.platform }})
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-22.04
bundles: deb,appimage
- platform: windows-latest
bundles: nsis
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Instalar dependências Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils xvfb imagemagick openbox dbus-x11 xdotool x11-utils
- name: Instalar Rust
run: |
rustup toolchain install stable --profile minimal --component rustfmt
rustup default stable
- run: npm ci
- name: Conferir versão e tag
shell: bash
run: python scripts/check-version.py
- name: Formatação e testes
run: |
cargo fmt --all -- --check
cargo test --workspace --locked
- name: Gerar instaladores
run: npm run desktop:build -- --bundles ${{ matrix.bundles }} -- --locked
- uses: actions/upload-artifact@v4
with:
name: reqlivo-${{ matrix.platform }}
if-no-files-found: error
path: |
target/release/bundle/deb/*.deb
target/release/bundle/appimage/*.AppImage
target/release/bundle/nsis/*.exe
- name: Abrir aplicativo Linux e capturar janela
if: runner.os == 'Linux'
env:
GDK_BACKEND: x11
NO_AT_BRIDGE: '1'
WEBKIT_DISABLE_COMPOSITING_MODE: '1'
LIBGL_ALWAYS_SOFTWARE: '1'
run: |
xvfb-run -a -s '-screen 0 1600x1000x24' dbus-run-session -- bash <<'SMOKE'
set -euo pipefail
unset WAYLAND_DISPLAY
openbox --sm-disable > window-manager.log 2>&1 &
manager_pid=$!
appimage=$(find target/release/bundle/appimage -name '*.AppImage' -print -quit)
"$appimage" --appimage-extract-and-run --collection examples/demo > desktop-smoke.log 2>&1 &
desktop_pid=$!
trap 'kill "$desktop_pid" "$manager_pid" 2>/dev/null || true' EXIT
rendered=0
for attempt in $(seq 1 30); do
kill -0 "$desktop_pid"
if window_id=$(xdotool search --onlyvisible --name '^Reqlivo$' | head -n 1); then
import -window "$window_id" desktop-linux.png
if test "$(identify -format '%k' desktop-linux.png)" -gt 20; then
rendered=1
break
fi
fi
sleep 1
done
xwininfo -root -tree >> desktop-smoke.log
test "$rendered" -eq 1
SMOKE
- name: Abrir aplicativo Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$app = Start-Process target/release/reqlivo-desktop.exe -ArgumentList '--collection', 'examples/demo' -PassThru
try {
Start-Sleep -Seconds 10
$app.Refresh()
if ($app.HasExited -or $app.MainWindowHandle -eq 0) { throw 'O aplicativo não abriu uma janela.' }
} finally {
if (-not $app.HasExited) { Stop-Process -Id $app.Id }
}
- uses: actions/upload-artifact@v4
if: always() && runner.os == 'Linux'
with:
name: desktop-smoke-linux
path: |
desktop-linux.png
desktop-smoke.log
window-manager.log

release:
name: Publicar release
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/download-artifact@v4
with:
pattern: reqlivo-*
path: installers
merge-multiple: true
- name: Publicar instaladores e checksums
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
shell: bash
run: |
mkdir release-assets
find installers -type f \( -name '*.deb' -o -name '*.AppImage' -o -name '*.exe' \) -exec cp {} release-assets/ \;
cd release-assets
sha256sum *.deb *.AppImage *.exe > SHA256SUMS
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release upload "$RELEASE_TAG" ./* --clobber
else
gh release create "$RELEASE_TAG" ./* --verify-tag --generate-notes --title "Reqlivo $RELEASE_TAG"
fi
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ docs/_site/
docs/.jekyll-cache/
__pycache__/
*.pyc

# Desktop Tauri
/node_modules/
/src-tauri/target/
/src-tauri/gen/
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ cargo run -- --collection examples/demo validate

Para testar a demonstração, inicie `python3 examples/servidor_demo.py` em outro terminal e execute `cargo run -- --collection examples/demo run --env dev`.

Para o desktop, instale os pré-requisitos em [desktop.md](docs/desktop.md), execute `npm ci` e `npm run desktop:dev`. O CI compila e empacota Linux/Windows.

Consulte o [guia de uso](docs/uso.md), o [formato da coleção](docs/formato.md) e as [limitações](docs/limitacoes.md) antes de propor funcionalidades maiores.

## Licença das contribuições
Expand Down
Loading
Loading