Attempts excplicit pip install for each architecture #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Executables | |
| on: | |
| push: | |
| branches: [actions-development] | |
| pull_request: | |
| branches: [actions-development] | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # Initializes and updates submodules | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" # Specify your Python version | |
| cache: "pip" # caching pip dependencies | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Download and Extract Mesa3D | |
| shell: pwsh # Specify PowerShell as the shell | |
| run: | | |
| curl -L -o mesa3d-22.1.5-release-mingw.7z https://github.com/pal1000/mesa-dist-win/releases/download/22.1.5/mesa3d-22.1.5-release-mingw.7z | |
| # Check if the file was downloaded | |
| if (Test-Path "mesa3d-22.1.5-release-mingw.7z") { | |
| # Extract the archive | |
| 7z x mesa3d-22.1.5-release-mingw.7z -aoa # -aoa to overwrite files if they exist | |
| } else { | |
| Write-Error "Failed to download Mesa3D archive." | |
| exit 1 | |
| } | |
| - name: Check for Mesa3D DLL | |
| shell: pwsh | |
| run: | | |
| if (Test-Path "./mesa3d/opengl32.dll") { | |
| Write-Host "Mesa3D DLL exists." | |
| } else { | |
| Write-Host "Mesa3D DLL does not exist." | |
| } | |
| - name: Add Mesa3D to Path | |
| run: | | |
| echo "$Env:UserProfile\mesa3d\mesa3d-22.1.5-release-mingw\libglapi.dll" >> $Env:Path | |
| echo "$Env:UserProfile\mesa3d\mesa3d-22.1.5-release-mingw\opengl32.dll" >> $Env:Path | |
| shell: pwsh | |
| - name: Build executable with PyInstaller | |
| run: | | |
| cd package | |
| pyinstaller --noconfirm --upx-dir upx/windows_upx.exe cogmood_windows.spec | |
| - name: Upload Windows executable | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: SUPREME | |
| path: dist/SUPREME.exe # Path to your Windows executable | |
| build-macos: | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # Initializes and updates submodules | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" # Specify your Python version | |
| - name: Check if Python is a fat binary | |
| run: | | |
| if lipo -info $(which python3) | grep -q "Architectures in the fat file"; then | |
| lipo -info $(which python3) | |
| echo "Python is a fat binary." | |
| else | |
| echo "Python is NOT a fat binary." | |
| exit 1 # Optional: Exit with error if you require a fat binary | |
| fi | |
| - name: Install Homebrew dependencies | |
| run: | | |
| brew update | |
| brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| arch -x86_64 pip install --no-binary :all: -r requirements.txt | |
| arch -arm64 pip install --no-binary :all: -r requirements.txt | |
| - name: Build executable with PyInstaller | |
| run: | | |
| cd package | |
| pyinstaller --noconfirm cogmood_mac.spec | |
| - name: Upload macOS executable | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: SUPREME | |
| path: dist/SUPREME |