Skip to content

Commit bee498b

Browse files
author
Pierre-Marie.fayette
committed
...
1 parent bfe31b8 commit bee498b

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Windows Executable
2+
3+
# Trigger the workflow
4+
on:
5+
push:
6+
branches: [ main, master ]
7+
pull_request:
8+
branches: [ main, master ]
9+
# Allow manual trigger
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-windows:
14+
runs-on: windows-latest
15+
16+
steps:
17+
# Checkout your repository code
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
# Set up Python
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.13'
26+
27+
# Install dependencies
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install pyinstaller
32+
# Install your project requirements
33+
if (Test-Path requirements.txt) { pip install -r requirements.txt }
34+
35+
# Build the executable
36+
- name: Build executable with PyInstaller
37+
run: |
38+
pyinstaller --onefile --windowed --name="PyImageLabeling" main.py
39+
# Alternative options:
40+
# --onefile: Create a single executable file
41+
# --windowed: Don't show console window (for GUI apps)
42+
# --console: Show console window (for CLI apps)
43+
# --icon=icon.ico: Add an icon (if you have one)
44+
45+
# Upload the executable as artifact
46+
- name: Upload executable
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: PyImageLabeling-Windows
50+
path: dist/*.exe
51+
retention-days: 30

0 commit comments

Comments
 (0)