Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build Windows Executable

# Trigger the workflow on push to main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: windows-latest

steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4

# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
if (Test-Path requirements.txt) { pip install -r requirements.txt }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The conditional dependency installation uses PowerShell syntax, which may not work in the default shell.

GitHub Actions on Windows uses cmd.exe by default, so this PowerShell syntax won't work. Use 'shell: pwsh' or a cmd-compatible conditional like 'if exist requirements.txt pip install -r requirements.txt' instead.


# Build executable
- name: Build executable
run: |
pyinstaller --onefile --name Question Question.py

# Upload the executable as artifact
- name: Upload executable
uses: actions/upload-artifact@v3
with:
name: windows-executable
path: dist/Question.exe
Loading