|
1 | | -name: Build Windows EXE (Simple) |
| 1 | + |
| 2 | +name: Build Windows EXE |
2 | 3 |
|
3 | 4 | on: |
| 5 | + push: |
| 6 | + branches: [ main ] |
4 | 7 | workflow_dispatch: |
5 | 8 |
|
6 | 9 | jobs: |
7 | 10 | build: |
8 | 11 | runs-on: windows-latest |
9 | | - timeout-minutes: 15 |
10 | | - |
| 12 | + |
11 | 13 | steps: |
12 | | - - name: Checkout code |
13 | | - uses: actions/checkout@v2 |
14 | | - |
15 | | - - name: Set up Python |
16 | | - uses: actions/setup-python@v2 |
17 | | - with: |
18 | | - python-version: '3.9' |
19 | | - architecture: 'x64' |
20 | | - |
21 | | - - name: Install dependencies |
22 | | - run: | |
23 | | - python -m pip install --upgrade pip |
24 | | - pip install pyinstaller==5.9.0 |
25 | | - pip install -r requirements.txt |
26 | | - |
27 | | - - name: Build executable |
28 | | - run: | |
29 | | - pyinstaller --onefile --name PDF_Splitter pdf_splitter_tkinter.py |
30 | | - dir dist |
31 | | - |
32 | | - - name: Upload artifact |
33 | | - uses: actions/upload-artifact@v2 |
34 | | - with: |
35 | | - name: PDF_Splitter |
36 | | - path: dist/PDF_Splitter.exe |
37 | | - retention-days: 90 |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Set up Python |
| 17 | + uses: actions/setup-python@v5 |
| 18 | + with: |
| 19 | + python-version: '3.9' |
| 20 | + |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + python -m pip install --upgrade pip |
| 24 | + pip install wheel setuptools |
| 25 | + pip install pyinstaller |
| 26 | + pip install PyMuPDF==1.25.3 |
| 27 | + pip install Pillow==11.1.0 |
| 28 | + pip install tk |
| 29 | + shell: cmd |
| 30 | + |
| 31 | + - name: List installed packages |
| 32 | + run: | |
| 33 | + pip list |
| 34 | + shell: cmd |
| 35 | + |
| 36 | + - name: Build EXE |
| 37 | + run: | |
| 38 | + echo "Current directory:" |
| 39 | + dir |
| 40 | + echo "Python version:" |
| 41 | + python -V |
| 42 | + echo "Building executable..." |
| 43 | + pyinstaller --name="PDFSplitter" --onefile --noconsole --clean ^ |
| 44 | + --add-data "pdf_splitter_tkinter.py;." ^ |
| 45 | + --hidden-import tkinter ^ |
| 46 | + --hidden-import PIL ^ |
| 47 | + --hidden-import PIL._tkinter_finder ^ |
| 48 | + pdf_splitter_tkinter.py |
| 49 | + shell: cmd |
| 50 | + |
| 51 | + - name: List build artifacts |
| 52 | + run: | |
| 53 | + echo "Dist directory contents:" |
| 54 | + dir dist |
| 55 | + echo "Build directory contents:" |
| 56 | + dir build |
| 57 | + shell: cmd |
| 58 | + |
| 59 | + - name: Upload artifact |
| 60 | + uses: actions/upload-artifact@v4 |
| 61 | + with: |
| 62 | + name: PDFSplitter |
| 63 | + path: dist/PDFSplitter.exe |
| 64 | + compression-level: 0 |
0 commit comments