fix(bundle): указать mainBinaryName + guard в CI (см. hotfix)

This commit is contained in:
by-sonic
2026-07-30 15:31:32 +03:00
parent a87e26c581
commit f0bfed6091
6 changed files with 48 additions and 4 deletions
+20
View File
@@ -29,6 +29,26 @@ jobs:
with:
components: rustfmt, clippy
# Оба бинаря лежат в одном крейте, и бандлер Tauri без явного указания
# может взять headless CLI как главный исполняемый файл приложения.
# Именно это уехало в v2.0.0-beta.2: .app и .deb содержали tglock-cli, и
# приложение не открывалось ни на одной платформе.
- name: Main binary of the bundle must be the GUI one
run: |
node -e "
const fs = require('fs');
const conf = JSON.parse(fs.readFileSync('tauri.conf.json', 'utf8'));
const toml = fs.readFileSync('Cargo.toml', 'utf8');
const gui = toml.split('[[bin]]').slice(1)
.find(b => /required-features\s*=\s*\[\s*\"gui\"\s*\]/.test(b));
if (!gui) throw new Error('не найден [[bin]] с required-features = [\"gui\"]');
const name = (gui.match(/name\s*=\s*\"([^\"]+)\"/) || [])[1];
if (conf.mainBinaryName !== name) {
throw new Error('mainBinaryName=' + conf.mainBinaryName + ', а GUI-бинарь называется ' + name);
}
console.log('mainBinaryName указывает на GUI-бинарь:', name);
"
- name: Check formatting
run: cargo fmt --check
+23
View File
@@ -75,6 +75,29 @@ jobs:
prerelease: false
args: ${{ matrix.args }}
# Смотрит внутрь собранного бандла. v2.0.0-beta.2 опубликовался с зелёным
# CI, хотя .app и .deb содержали headless CLI вместо приложения: сборка
# была успешной, просто никто не проверял, что внутри.
- name: The bundle must contain the GUI binary
if: runner.os == 'macOS'
shell: bash
run: |
app=$(find target -maxdepth 6 -name 'TGLock.app' -type d | head -1)
test -n "$app" || { echo "TGLock.app не найден"; exit 1; }
exe=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$app/Contents/Info.plist")
echo "CFBundleExecutable = $exe"
test "$exe" = "tglock" || { echo "в бандле не GUI-бинарь"; exit 1; }
test -x "$app/Contents/MacOS/tglock" || { echo "исполняемый файл отсутствует"; exit 1; }
- name: The bundle must contain the GUI binary
if: runner.os == 'Linux'
shell: bash
run: |
deb=$(find target -maxdepth 6 -name '*.deb' | head -1)
test -n "$deb" || { echo ".deb не найден"; exit 1; }
dpkg-deb -c "$deb" | grep -E ' \./usr/bin/tglock$' \
|| { echo "в .deb нет /usr/bin/tglock:"; dpkg-deb -c "$deb" | grep '/bin/'; exit 1; }
cli:
name: Headless CLI ${{ matrix.platform }}
needs: publish
Generated
+1 -1
View File
@@ -3799,7 +3799,7 @@ dependencies = [
[[package]]
name = "tglock"
version = "2.0.0-beta.2"
version = "2.0.0-beta.3"
dependencies = [
"aes",
"cipher",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "tglock"
version = "2.0.0-beta.2"
version = "2.0.0-beta.3"
edition = "2021"
rust-version = "1.88"
description = "Telegram unblock via local WebSocket tunnel"
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "tglock-ui",
"private": true,
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"type": "module",
"scripts": {
"dev": "vite --port 1420",
+2 -1
View File
@@ -1,8 +1,9 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "TGLock",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"identifier": "com.bysonic.tglock",
"mainBinaryName": "tglock",
"build": {
"beforeDevCommand": "npm run dev",
"devUrl": "http://localhost:1420",