diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 38e40b5..be52112 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -5,6 +5,7 @@ on: push: branches: - main + - build-ci jobs: Build: @@ -13,24 +14,38 @@ jobs: - name: Charger le dépôt uses: actions/checkout@v4 - - name: Installer Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - - name: Installer Nuitka et MinGW + - name: Installer Wine, wget, unzip run: | - python -m pip install --upgrade pip - pip install pyinstaller colorama + sudo dpkg --add-architecture i386 + sudo apt update + sudo install -y wine64 wine32 unzip wget - - name: Execute PyInstaller dans Docker + - name: Initialiser l'environnement Windows run: | - docker run --rm -v "$PWD":/src cdrx/pyinstaller-windows \ - "pyinstaller --onefile /src/controleur_de_gaz.py" + mkdir -p wine-python + cd wine-python + + # Télécharger l'installeur MSI de Python + wget https://www.python.org/ftp/python/3.11.8/python-3.11.8-amd64.exe -O python-installer.exe + + # Installer Python via Wine + wine python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_pip=1 + + wine 'C:\Program Files\Python311\python.exe' --version + + - name: Installer PyInstaller + run: | + wine 'C:\Program Files\Python311\python.exe' -m pip install --upgrade pip + wine 'C:\Program Files\Python311\python.exe' -m pip install pyinstaller + + - name: Build executable with pyinstaller + run: | + pyinstaller --onefile controleur_de_gaz.py - name: Archive executable run: | - zip jeu_windows.zip ./dist/controleur_de_gaz.exe + cd /workspace/Simon/cmd-alexandra-toxicity/dist + zip jeu_windows.zip ./controleur_de_gaz.exe - name: Upload Artifact uses: actions/upload-artifact@v4