Skip to content

Commit 64d3fa2

Browse files
authored
Merge pull request #678 from mathoudebine/dev/generate-debug-installer
Generate debug installer for Windows
2 parents 9e7331a + 0aa0e5c commit 64d3fa2

File tree

5 files changed

+66
-3
lines changed

5 files changed

+66
-3
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Generate Windows Installer (Debug)
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
generate-windows-installer:
12+
name: Generate Windows Installer (Debug)
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: Git Checkout ${{github.event.release.tag_name}}
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.13'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install -r requirements.txt
28+
29+
- name: Set version number for PyInstaller
30+
run: |
31+
python.exe tools\windows-installer\generate-version-info.py ${{github.event.release.tag_name}} debug
32+
33+
- name: Run PyInstaller to create binaries
34+
run: |
35+
pyinstaller.exe --noconfirm turing-system-monitor-debug.spec
36+
37+
- name: Create InnoSetup installer from generated binaries
38+
uses: Minionguyjpro/[email protected]
39+
with:
40+
path: tools/windows-installer/turing-system-monitor.iss
41+
options: /O+
42+
43+
- name: '📦 Archive Windows installer'
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: turing-system-monitor_${{github.event.release.tag_name}}
47+
path: tools\windows-installer\Output\turing-system-monitor-${{github.event.release.tag_name}}-debug.exe
48+
if-no-files-found: error
49+
50+
- name: '📩 Publish Windows installer to Release'
51+
run: |
52+
gh release upload ${{github.event.release.tag_name}} tools\windows-installer\Output\turing-system-monitor-${{github.event.release.tag_name}}-debug.exe
53+
env:
54+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/generate-windows-installer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ jobs:
4444
uses: actions/upload-artifact@v4
4545
with:
4646
name: turing-system-monitor_${{github.event.release.tag_name}}
47-
path: tools\windows-installer\Output\turing-system-monitor_${{github.event.release.tag_name}}.exe
47+
path: tools\windows-installer\Output\turing-system-monitor-${{github.event.release.tag_name}}.exe
4848
if-no-files-found: error
4949

5050
- name: '📩 Publish Windows installer to Release'
5151
run: |
52-
gh release upload ${{github.event.release.tag_name}} tools\windows-installer\Output\turing-system-monitor_${{github.event.release.tag_name}}.exe
52+
gh release upload ${{github.event.release.tag_name}} tools\windows-installer\Output\turing-system-monitor-${{github.event.release.tag_name}}.exe
5353
env:
5454
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tools/windows-installer/generate-version-info.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
revision = int(version[2])
4040
build = 0 # For this project we only use 3-digit versions
4141

42+
if sys.argv[2] == "debug":
43+
print (f"Generating debug version {major}.{minor}.{revision}-debug")
44+
debug_version = True
45+
else:
46+
print (f"Generating version {major}.{minor}.{revision}")
47+
debug_version = False
48+
4249
# Update FixedFileInfo version
4350
info.ffi.fileVersionMS = (major << 16) + minor
4451
info.ffi.fileVersionLS = (revision << 16) + build
@@ -49,6 +56,8 @@
4956
for elem in info.kids[0].kids[0].kids:
5057
if elem.name == 'ProductVersion' or elem.name == 'FileVersion':
5158
elem.val = f"{major}.{minor}.{revision}"
59+
if debug_version:
60+
elem.val += "-debug"
5261

5362
# Update version file with new info, to be used by PyInstaller
5463
with codecs.open(VERSION_INFO_FILE, 'w', 'utf-8') as fp:

tools/windows-installer/turing-system-monitor.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ AppSupportURL={#MyAppURL}/wiki
2222
AppUpdatesURL={#MyAppURL}/releases
2323
DefaultDirName={autopf}\{#MyAppName}
2424
DefaultGroupName={#MyAppName}
25-
OutputBaseFilename=turing-system-monitor_{#MyAppVersion}
25+
OutputBaseFilename=turing-system-monitor-{#MyAppVersion}
2626
AllowNoIcons=yes
2727
PrivilegesRequired=lowest
2828
Compression=lzma
File renamed without changes.

0 commit comments

Comments
 (0)