import error fix, and pipeline
Some checks failed
Build MuCaPy Executable / build-windows-exe (push) Failing after 2m52s
Some checks failed
Build MuCaPy Executable / build-windows-exe (push) Failing after 2m52s
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
name: Build MuCaPy Executable
|
name: Build MuCaPy Executable
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -7,36 +8,38 @@ on:
|
|||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-package:
|
build-windows-exe:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python 3.10
|
- name: Install dependencies for Wine
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
sudo dpkg --add-architecture i386
|
||||||
pip install -r requirements.txt
|
sudo apt update
|
||||||
|
sudo apt install -y wine64 wine32 unzip wget cabextract
|
||||||
|
|
||||||
- name: Install PyInstaller
|
- name: Install Windows Python under Wine
|
||||||
run: pip install pyinstaller
|
|
||||||
|
|
||||||
- name: Build executable with PyInstaller
|
|
||||||
run: |
|
run: |
|
||||||
pyinstaller --onefile --windowed mucapy/main.py \
|
wget https://www.python.org/ftp/python/3.10.13/python-3.10.13-amd64.exe -O python_installer.exe
|
||||||
--add-data "mucapy/styling:styling" \
|
wine python_installer.exe /quiet InstallAllUsers=1 PrependPath=1
|
||||||
--add-data "mucapy/models:models" \
|
|
||||||
--add-data "mucapy/todopackage:todopackage"
|
|
||||||
|
|
||||||
- name: Upload executable artifact
|
- name: Upgrade pip and install PyInstaller (Windows)
|
||||||
|
run: |
|
||||||
|
wine python -m pip install --upgrade pip
|
||||||
|
wine python -m pip install pyinstaller
|
||||||
|
|
||||||
|
- name: Build Windows executable
|
||||||
|
run: |
|
||||||
|
wine pyinstaller --onefile --windowed mucapy/main.py \
|
||||||
|
--add-data "mucapy/styling;styling" \
|
||||||
|
--add-data "mucapy/models;models" \
|
||||||
|
--add-data "mucapy/todopackage;todopackage"
|
||||||
|
|
||||||
|
- name: Upload Windows executable
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mucapy-executable
|
name: mucapy-windows-exe
|
||||||
path: dist/
|
path: dist/
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import json
|
import json
|
||||||
|
try:
|
||||||
import winreg
|
import winreg
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|||||||
Reference in New Issue
Block a user