1- name : Build Windows EXE
1+ name : Build and Release
22
33on :
44 push :
5- branches : [ "main", "master" ]
65 tags :
7- - ' v*'
8- pull_request :
9- branches : [ "main", "master" ]
10- workflow_dispatch :
6+ - " v*" # Triggers on tags like v1.0, v2.3.4
7+ workflow_dispatch : # Allows manual triggering from GitHub UI
118
129permissions :
1310 contents : write
@@ -17,40 +14,33 @@ jobs:
1714 runs-on : windows-latest
1815
1916 steps :
20- - name : Checkout Code
21- uses : actions/checkout@v4
22-
23- - name : Set up Python
24- uses : actions/setup-python@v4
25- with :
26- python-version : ' 3.11'
27-
28- - name : Install Dependencies
29- run : |
30- python -m pip install --upgrade pip
31- pip install pyinstaller pillow tkinterdnd2
32-
33- - name : Build EXE
34- run : |
35- pyinstaller build.spec
36-
37- - name : Upload Artifact
38- uses : actions/upload-artifact@v4
39- with :
40- name : BZ98R_ModManager_EXE
41- path : dist/BZ98R_ModManager.exe
42-
43- - name : Create Release
44- if : startsWith(github.ref, 'refs/tags/')
45- uses : softprops/action-gh-release@v1
46- with :
47- files : dist/BZ98R_ModManager.exe
48-
49- - name : Update Nightly Release
50- if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
51- uses : softprops/action-gh-release@v1
52- with :
53- tag_name : nightly
54- name : Nightly Build
55- prerelease : true
56- files : dist/BZ98R_ModManager.exe
17+ - name : Checkout repository
18+ uses : actions/checkout@v4
19+
20+ - name : Set up Python
21+ uses : actions/setup-python@v5
22+ with :
23+ python-version : " 3.11"
24+
25+ - name : Install dependencies
26+ run : |
27+ python -m pip install --upgrade pip
28+ pip install Pillow tkinterdnd2 pyinstaller
29+
30+ - name : Build Executable
31+ # --collect-all tkinterdnd2 is crucial for the drag-and-drop library to work in the exe
32+ run : |
33+ pyinstaller --noconfirm --onefile --windowed --name "BZ98R Mod Manager" --icon "modman.ico" --add-data "modman.ico;." --add-data "bzone.ttf;." --collect-all tkinterdnd2 cmd.py
34+
35+ - name : Upload Artifact
36+ uses : actions/upload-artifact@v4
37+ with :
38+ name : BZ98R Mod Manager
39+ path : dist/BZ98R Mod Manager.exe
40+
41+ - name : Create Release
42+ if : startsWith(github.ref, 'refs/tags/')
43+ uses : softprops/action-gh-release@v2
44+ with :
45+ files : dist/BZ98R Mod Manager.exe
46+ generate_release_notes : true
0 commit comments