Release v1.0.0: deb + flatpak + windows 打包脚本

This commit is contained in:
QQ 2026-07-07 09:24:33 +08:00
parent fc1da8974b
commit a2bdb0c99a
10 changed files with 191 additions and 0 deletions

8
.gitignore vendored
View File

@ -2,6 +2,7 @@ __pycache__/
*.pyc *.pyc
*.pyo *.pyo
.venv/ .venv/
.build-venv/
venv/ venv/
*.egg-info/ *.egg-info/
dist/ dist/
@ -12,3 +13,10 @@ build/
*~ *~
*.csv *.csv
*_frames/ *_frames/
# 打包产物(不进仓库)
*.deb
*.tar.gz
# Flatpak 和 deb 里的大二进制文件
packaging/deb/actuator-reader/usr/bin/
packaging/flatpak/actuator-reader
packaging/flatpak/*.png

43
actuator-reader.spec Normal file
View File

@ -0,0 +1,43 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[
'cv2',
'numpy',
'PyQt6.QtCore',
'PyQt6.QtGui',
'PyQt6.QtWidgets',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='actuator-reader',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

46
build-release.sh Normal file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
# 构建所有平台的发布包
set -e
VERSION="1.0.0"
ROOT="$(cd "$(dirname "$0")" && pwd)"
DIST="$ROOT/dist"
echo "=== Building Actuator Reader v$VERSION ==="
# 1. PyInstaller Linux binary
echo "[1/3] Building Linux binary..."
cd "$ROOT"
if [ ! -d .build-venv ]; then
python3 -m venv .build-venv
.build-venv/bin/pip install pyinstaller opencv-python numpy PyQt6
fi
.build-venv/bin/pyinstaller --clean --noconfirm actuator-reader.spec
# 2. DEB package
echo "[2/3] Building .deb package..."
rm -rf packaging/deb/actuator-reader/usr/bin/actuator-reader
cp "$DIST/actuator-reader" packaging/deb/actuator-reader/usr/bin/
cd packaging/deb
dpkg-deb --build --root-owner-group actuator-reader "actuator-reader_${VERSION}_amd64.deb"
cp "actuator-reader_${VERSION}_amd64.deb" "$DIST/"
cd "$ROOT"
# 3. Flatpak bundle (manifest + binary)
echo "[3/3] Preparing Flatpak..."
cp "$DIST/actuator-reader" packaging/flatpak/
cd packaging/flatpak
tar czf "$DIST/actuator-reader-${VERSION}-flatpak-sources.tar.gz" \
actuator-reader \
top.qyhhh.actuator-reader.yml \
top.qyhhh.actuator-reader.desktop \
top.qyhhh.actuator-reader.png \
top.qyhhh.actuator-reader.metainfo.xml
cd "$ROOT"
echo ""
echo "=== Done ==="
echo "Linux binary: dist/actuator-reader"
echo "DEB package: dist/actuator-reader_${VERSION}_amd64.deb"
echo "Flatpak sources: dist/actuator-reader-${VERSION}-flatpak-sources.tar.gz"
echo "Windows: packaging/windows/build.bat (在 Windows 上运行)"

View File

@ -0,0 +1,11 @@
Package: actuator-reader
Version: 1.0.0
Section: science
Priority: optional
Architecture: amd64
Depends: libc6 (>= 2.28), libgl1, libglib2.0-0, libxcb-cursor0
Maintainer: Newbie <newbie@qyhhh.top>
Description: 制动器角度读取工具
读取视频中的制动器弯曲角度。
手动点击标记点 O圆心、M初始尾端、M2当前尾端
计算偏离角 ∠M2-O-M支持逐帧测量、方向矫正、CSV 导出。

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=Actuator Reader
Name[zh_CN]=
Comment=Brake actuator angle measurement tool
Comment[zh_CN]=
Exec=actuator-reader
Icon=actuator-reader
Terminal=false
Categories=Science;Engineering;

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=Actuator Reader
Comment=Brake actuator angle measurement tool
Exec=actuator-reader
Icon=top.qyhhh.actuator-reader
Terminal=false
Categories=Science;Engineering;

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>top.qyhhh.actuator-reader</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>Actuator Reader</name>
<name xml:lang="zh_CN">制动器角度读取</name>
<summary>Brake actuator angle measurement tool</summary>
<summary xml:lang="zh_CN">制动器弯曲角度测量工具</summary>
<description>
<p>Read actuator bending angles from video. Click marker points O (center),
M (initial tip), M2 (current tip) to measure deviation angle ∠M2-O-M.</p>
<p xml:lang="zh_CN">从视频中读取制动器弯曲角度。点击标记点 O圆心
M初始尾端、M2当前尾端计算偏离角 ∠M2-O-M。</p>
</description>
<url type="homepage">https://git.qyhhh.top/newbie/Actuators</url>
<releases>
<release version="1.0.0" date="2025-07-07"/>
</releases>
</component>

View File

@ -0,0 +1,30 @@
app-id: top.qyhhh.actuator-reader
runtime: org.kde.Platform
runtime-version: "6.7"
sdk: org.kde.Sdk
command: actuator-reader
finish-args:
- --socket=wayland
- --socket=fallback-x11
- --socket=pulseaudio
- --share=ipc
- --device=dri
- --filesystem=host
modules:
- name: actuator-reader
buildsystem: simple
build-commands:
- install -Dm755 actuator-reader /app/bin/actuator-reader
- install -Dm644 top.qyhhh.actuator-reader.desktop /app/share/applications/top.qyhhh.actuator-reader.desktop
- install -Dm644 top.qyhhh.actuator-reader.png /app/share/icons/hicolor/256x256/apps/top.qyhhh.actuator-reader.png
- install -Dm644 top.qyhhh.actuator-reader.metainfo.xml /app/share/metainfo/top.qyhhh.actuator-reader.metainfo.xml
sources:
- type: file
path: actuator-reader
- type: file
path: top.qyhhh.actuator-reader.desktop
- type: file
path: top.qyhhh.actuator-reader.png
- type: file
path: top.qyhhh.actuator-reader.metainfo.xml

View File

@ -0,0 +1,15 @@
:: Windows 打包脚本 — 在 Windows 上运行
:: 前提:安装 Python 3.10+,然后 pip install pyinstaller opencv-python numpy PyQt6
pyinstaller --clean --noconfirm ^
--name "actuator-reader" ^
--windowed ^
--hidden-import cv2 ^
--hidden-import numpy ^
--hidden-import PyQt6.QtCore ^
--hidden-import PyQt6.QtGui ^
--hidden-import PyQt6.QtWidgets ^
main.py
echo Build complete: dist\actuator-reader.exe
pause