- Add core module with SMART data parsing and health calculation - Add CLI with Rich-based terminal UI and health bar visualization - Add GUI with PyQt6 tabs for summary and detailed views - Support multiple health indicators (ID 231, 169, 233) for different SSD manufacturers - Add bilingual support (Russian/English) with auto-detection - Add GitHub Actions workflow for building binaries on Linux, Windows, macOS - Calculate health based on reallocated sectors, pending sectors, SSD life, and more Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
197 lines
5.1 KiB
YAML
197 lines
5.1 KiB
YAML
name: Build Binaries
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches: [main, master]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y smartmontools libegl1 libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxkbcommon0 libdbus-1-3
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Verify imports
|
|
run: |
|
|
python -c "from smart_report.cli import main; print('CLI OK')"
|
|
python -c "from smart_report.gui import main; print('GUI OK')"
|
|
|
|
- name: Build CLI binary
|
|
run: |
|
|
pyinstaller --name smart-report --onefile smart_report/cli.py
|
|
|
|
- name: Build GUI binary
|
|
run: |
|
|
pyinstaller --name smart-report-gui --onefile --windowed smart_report/gui.py
|
|
|
|
- name: List built binaries
|
|
run: |
|
|
ls -lh dist/
|
|
|
|
- name: Test CLI binary
|
|
run: |
|
|
dist/smart-report --help
|
|
|
|
- name: Upload CLI artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: smart-report-linux
|
|
path: dist/smart-report
|
|
|
|
- name: Upload GUI artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: smart-report-gui-linux
|
|
path: dist/smart-report-gui
|
|
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Verify imports
|
|
run: |
|
|
python -c "from smart_report.cli import main; print('CLI OK')"
|
|
python -c "from smart_report.gui import main; print('GUI OK')"
|
|
|
|
- name: Build CLI binary
|
|
run: |
|
|
pyinstaller --name smart-report --onefile smart_report/cli.py
|
|
|
|
- name: Build GUI binary
|
|
run: |
|
|
pyinstaller --name smart-report-gui --onefile --windowed smart_report/gui.py
|
|
|
|
- name: List built binaries
|
|
run: |
|
|
ls -lh dist/
|
|
|
|
- name: Test CLI binary
|
|
run: |
|
|
dist/smart-report.exe --help
|
|
|
|
- name: Upload CLI artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: smart-report-windows
|
|
path: dist/smart-report.exe
|
|
|
|
- name: Upload GUI artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: smart-report-gui-windows
|
|
path: dist/smart-report-gui.exe
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Verify imports
|
|
run: |
|
|
python -c "from smart_report.cli import main; print('CLI OK')"
|
|
python -c "from smart_report.gui import main; print('GUI OK')"
|
|
|
|
- name: Build CLI binary
|
|
run: |
|
|
pyinstaller --name smart-report --onefile smart_report/cli.py
|
|
|
|
- name: Build GUI binary
|
|
run: |
|
|
pyinstaller --name smart-report-gui --onefile --windowed smart_report/gui.py
|
|
|
|
- name: List built binaries
|
|
run: |
|
|
ls -lh dist/
|
|
|
|
- name: Test CLI binary
|
|
run: |
|
|
dist/smart-report --help
|
|
|
|
- name: Upload CLI artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: smart-report-macos
|
|
path: dist/smart-report
|
|
|
|
- name: Upload GUI artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: smart-report-gui-macos
|
|
path: dist/smart-report-gui
|
|
|
|
release:
|
|
needs: [build-linux, build-windows, build-macos]
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Prepare release files
|
|
run: |
|
|
cd artifacts
|
|
ls -R
|
|
# Create checksums
|
|
for dir in */; do
|
|
cd "$dir"
|
|
for file in *; do
|
|
sha256sum "$file" > "${file}.sha256"
|
|
done
|
|
cd ..
|
|
done
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: artifacts/**/*
|
|
draft: false
|
|
prerelease: false
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|