Create main.yml #1
This file contains 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 Executable | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: # Allows manual triggers from GitHub UI | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' # Replace with your Python version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build executable | |
run: | | |
pyinstaller --onefile your_script.py | |
- name: Upload executable | |
uses: actions/upload-artifact@v2 | |
with: | |
name: my-executable | |
path: dist/pyos.exe | |
- name: Clean up | |
run: | | |
rm -rf build dist __pycache__ your_script.spec |