name: Build Windows
on: [push, pull_request]

jobs:
  build:
    name: Build Windows
    runs-on: ubuntu-latest
    container:
      image: tobix/pywine:3.10
    steps:
      - name: Install Node.js
        run: |
          apt-get update
          apt-get install -y nodejs npm

      - name: Checkout
        uses: actions/checkout@v3

      - name: Install Dependencies
        run: |
          wine python -m pip install --upgrade pip
          wine pip install -r requirements.txt

      - name: Build Executable
        run: |
          wine pyinstaller --onefile --windowed --name TeletextEditor_Windows.exe --paths src --add-data "app_icon.png;." --icon=app_icon.ico src/main.py

      - name: Upload Artifact
        uses: actions/upload-artifact@v3
        with:
          name: TeletextEditor-Windows
          path: dist/TeletextEditor_Windows.exe
