mirror of
https://github.com/EDeev/school_table.git
synced 2026-10-07 20:49:37 +03:00
requirements.txt, CI и сборка .exe в релиз
CI: ruff и запуск окна в offscreen-режиме с чтением базы. По тегу v* GitHub Actions собирает SchoolTable.exe (PyInstaller) и кладёт в релиз архив с exe, пустой базой и иконкой.
This commit is contained in:
parent
396e2c66b6
commit
031082f4c0
3 changed files with 58 additions and 0 deletions
32
.github/workflows/ci.yml
vendored
Normal file
32
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- run: sudo apt-get update -qq && sudo apt-get install -y -qq libegl1 libxkbcommon0 libdbus-1-3
|
||||
- run: pip install ruff==0.14.0 -r requirements.txt
|
||||
- name: Ruff (синтаксис и ошибки)
|
||||
run: ruff check --select E9,F main.py
|
||||
- name: Окно открывается и читает базу
|
||||
env:
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
run: |
|
||||
python -c "
|
||||
import sys
|
||||
from PyQt5.QtWidgets import QApplication, QMessageBox
|
||||
QMessageBox.about = staticmethod(lambda *a: sys.exit('ошибка: ' + a[2]))
|
||||
import main
|
||||
app = QApplication(sys.argv)
|
||||
w = main.MyWidget()
|
||||
assert w.Mon_school.rowCount() == 8
|
||||
print('ok')"
|
||||
25
.github/workflows/release.yml
vendored
Normal file
25
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
exe:
|
||||
runs-on: windows-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- run: pip install pyinstaller -r requirements.txt
|
||||
- name: Сборка .exe
|
||||
run: pyinstaller --onefile --windowed --icon image.ico --name SchoolTable main.py
|
||||
- name: Архив с программой, пустой базой и иконкой
|
||||
run: Compress-Archive -Path dist/SchoolTable.exe, table.db, image.ico -DestinationPath SchoolTable-windows.zip
|
||||
- name: Файл в релиз
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: gh release upload "${{ github.ref_name }}" SchoolTable-windows.zip --clobber
|
||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
PyQt5==5.15.11
|
||||
Loading…
Add table
Reference in a new issue