Skip to content

Commit 9809250

Browse files
committed
Windows Build GitHub Action
1 parent 338abc5 commit 9809250

4 files changed

Lines changed: 61 additions & 7 deletions

File tree

.github/workflows/win_build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build Application with PyInstaller on Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
name: Check out the repository code
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.12'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements.txt
27+
28+
- name: Build the executable with PyInstaller
29+
run: |
30+
pyinstaller --noconfirm --onedir --windowed --icon ".\cmdcompass\static\icon.ico" --name "cmdCompass" `
31+
--add-data ".\cmdcompass\data:data" `
32+
--add-data ".\cmdcompass\static:static" `
33+
--add-data "C:\Users\John W\AppData\Local\Programs\Python\Python312\Lib\site-packages\customtkinter:customtkinter" `
34+
--collect-all "tkinterweb" `
35+
--distpath ".\dist" `
36+
".\cmdcompass\main.py"
37+
38+
- name: Reorganize Files
39+
run: |
40+
Move-Item .\dist\_internal\data .\dist\data
41+
Move-Item .\dist\_internal\static .\dist\static
42+
43+
- name: Create zip Archive
44+
run: |
45+
Compress-Archive -Path .\dist\* -DestinationPath .\dist\cmdCompass.zip
46+
47+
- name: Create 7z Archive
48+
run: |
49+
7z a .\dist\cmdCompass.7z .\dist\*
50+
51+
- name: Upload Artifacts
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: cmdCompass-artifacts
55+
path: |
56+
.\dist\cmdCompass.zip
57+
.\dist\cmdCompass.7z

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### ADDED
44
* Create dmg installer for Mac build
55
* Add a new window to allow user to set their defined man page for a command with hint from the db.
6+
* Add GitHub action for Windows build.
67

78
### CHANGED
89
* GUI improvements.

cmdcompass/gui/main_window.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __init__(self):
106106
CTkToolTip(tag_operations_button, message="Define/Remove Tags here to be later assigned to commands")
107107

108108
# Create scrollable frame for the command list
109-
self.command_list_frame = ctk.CTkScrollableFrame(self.left_frame, height=450, width=230)
109+
self.command_list_frame = ctk.CTkScrollableFrame(self.left_frame, height=450, width=240)
110110
self.command_list_frame.grid(row=3, column=0, padx=10, pady=10, sticky="nsew")
111111

112112
# Configure scrolling behavior
@@ -278,15 +278,10 @@ def update_command_list(self, commands):
278278
)
279279
self.add_command_button.grid(row=0, column=0, pady=5, padx=10, sticky="ew")
280280
CTkToolTip(self.add_command_button, message="Add a new command to this Collection")
281-
max_width = 0
282281
for i, command in enumerate(commands):
283282
tags = [self.data_manager.tags[tag_id] for tag_id in command.tag_ids]
284283
command_box = CommandBox(self.command_list_frame, command, tags, i, self)
285284
command_box.grid(row=i+1, column=0, pady=5, padx=0, sticky="ew")
286-
self.command_list_frame.update_idletasks() # Force the frame to update
287-
max_width = max(max_width, command_box.winfo_reqwidth()) # Get the required width
288-
# Set the width of the command_list_frame based on the widest CommandBox
289-
self.command_list_frame.configure(width=max_width + 3)
290285

291286
def add_new_command(self):
292287
# Get the currently selected collection

cmdcompass/gui/manpagebox.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,5 @@ def open_set_man_page_window(self):
130130
suggestion.append(command)
131131
suggestion.sort()
132132

133-
set_man_page_window.set_suggestions(suggestion)
133+
set_man_page_window.set_suggestions(suggestion)
134+
set_man_page_window.grab_set()

0 commit comments

Comments
 (0)