Fix: Include cterasdk data files in PyInstaller build #3
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 Windows Executable | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: # Allows manual triggering from GitHub UI | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Build executable with PyInstaller | |
| run: | | |
| pyinstaller --name ctools --onefile --windowed --collect-data cterasdk ctools.py | |
| - name: List dist contents | |
| run: | | |
| dir dist | |
| - name: Upload executable | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ctools-windows-exe | |
| path: dist/ctools.exe | |
| retention-days: 90 | |
| - name: Create Release (on tag push) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/ctools.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |