Skip to content

Commit 0526482

Browse files
Create main.yml
1 parent ac7c8b5 commit 0526482

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Windows Executable
2+
3+
# Trigger the workflow on push to main branch
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
14+
steps:
15+
# Checkout the code
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
# Set up Python
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.11'
24+
25+
# Install dependencies
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install pyinstaller
30+
if (Test-Path requirements.txt) { pip install -r requirements.txt }
31+
32+
# Build executable
33+
- name: Build executable
34+
run: |
35+
pyinstaller --onefile --name Question Question.py
36+
37+
# Upload the executable as artifact
38+
- name: Upload executable
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: windows-executable
42+
path: dist/Question.exe

0 commit comments

Comments
 (0)