Rename EXE file in Windows build workflow #4
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 EXE and push to new branch | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| - name: Build EXE | |
| run: | | |
| pyinstaller --onefile main.py | |
| - name: Setup Git | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "[email protected]" | |
| - name: Commit EXE to new branch | |
| run: | | |
| git checkout -b windows-build | |
| mkdir -p exe | |
| mv dist/main.exe exe/ | |
| git add exe/main.exe | |
| git commit -m "Add Windows EXE build" | |
| git push --set-upstream origin windows-build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-exe | |
| path: exe/main.exe |