@@ -3,77 +3,144 @@ name: Release Build
33on :
44 push :
55 branches : [ "main", "master" ]
6+ workflow_dispatch :
7+ inputs :
8+ version :
9+ description : ' Release version (e.g., 1.0.0)'
10+ required : true
11+ type : string
12+ changelog :
13+ description : ' Changelog/Release notes (use " - " to separate items)'
14+ required : false
15+ type : string
16+ default : ' Manual release'
617
718permissions :
819 contents : write
920
1021jobs :
1122 build-and-release :
12- if : contains(github.event.head_commit.message, 'release:')
23+ if : github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, 'release:')
1324 runs-on : windows-latest
1425
1526 steps :
1627 - uses : actions/checkout@v4
1728 with :
1829 fetch-depth : 0
1930
20- - name : Set up Python
21- uses : actions/setup-python@v5
31+ - name : Install Qt
32+ uses : jurplel/install-qt-action@v3
2233 with :
23- python-version : ' 3.13'
24- cache : ' pip'
34+ version : ' 6.6.0'
35+ host : ' windows'
36+ target : ' desktop'
37+ arch : ' win64_mingw'
38+ modules : ' qtnetworkauth'
39+ cache : true
2540
26- - name : Install dependencies
41+ - name : Setup MinGW
2742 run : |
28- python -m pip install --upgrade pip
29- if (Test-Path requirements.txt) { pip install -r requirements.txt }
30- # Ensure PyInstaller is installed if not in requirements (it should be)
31- pip install pyinstaller
43+ choco install mingw --version=11.2.0.07112021 --force -y
44+ echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
45+ shell : pwsh
46+
47+ - name : Setup CMake
48+ uses : jwlawson/actions-setup-cmake@v1.14
49+ with :
50+ cmake-version : ' 3.27.x'
51+
52+ - name : Configure CMake
53+ run : |
54+ mkdir build
55+ cd build
56+ cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..
57+ shell : cmd
58+
59+ - name : Build
60+ run : |
61+ cd build
62+ cmake --build . --config Release
63+ shell : cmd
64+
65+ - name : Create Distribution Package
66+ run : |
67+ mkdir dist
68+ copy build\SteamLuaPatcher.exe dist\
69+ if exist logo.ico copy logo.ico dist\
70+ cd dist
71+ windeployqt SteamLuaPatcher.exe --release --no-translations
72+ shell : cmd
73+
74+ - name : Create Installer (Optional - using NSIS)
75+ run : |
76+ echo "Skipping installer creation - direct exe distribution"
77+ shell : cmd
3278
33- - name : Build with PyInstaller
79+ - name : Package Release
3480 run : |
35- python build.py
81+ cd dist
82+ 7z a ..\SteamLuaPatcher-Windows.zip *
83+ shell : cmd
3684
3785 - name : Extract Version from Commit Message
3886 id : get_info
3987 shell : pwsh
4088 run : |
41- $msg = "${{ github.event.head_commit.message }}"
42- # Regex to find "release: <version>" (case insensitive)
43- if ($msg -match "(?i)release:\s*v?([\d\.]+)") {
44- $version = $matches[1]
89+ # Check if this is a manual trigger
90+ if ("${{ github.event_name }}" -eq "workflow_dispatch") {
91+ $version = "${{ github.event.inputs.version }}"
4592 echo "VERSION=$version" >> $env:GITHUB_OUTPUT
46- echo "Found version : $version"
93+ echo "Manual trigger - Version : $version"
4794 } else {
48- echo "VERSION=latest" >> $env:GITHUB_OUTPUT
49- echo "No specific version found, using 'latest'"
95+ # Extract from commit message
96+ $msg = "${{ github.event.head_commit.message }}"
97+ if ($msg -match "(?i)release:\s*v?([\d\.]+)") {
98+ $version = $matches[1]
99+ echo "VERSION=$version" >> $env:GITHUB_OUTPUT
100+ echo "Commit trigger - Found version: $version"
101+ } else {
102+ echo "VERSION=latest" >> $env:GITHUB_OUTPUT
103+ echo "No specific version found, using 'latest'"
104+ }
50105 }
51106
52107 - name : Generate Changelog
53108 id : changelog
54109 shell : pwsh
55110 run : |
56- $msg = "${{ github.event.head_commit.message }}"
57-
58- # Split by " - " which the user uses as separator
59- # using -split with Regex escape might be safer, but simple string split works for " - "
60- $parts = $msg -split " - "
61-
62- $changelog = ""
63- foreach ($part in $parts) {
64- # Skip the "release:" part if it's the first one, or just clean it up
65- if ($part -match "^release:") { continue }
66-
67- # Format as list item
68- $changelog += "- $part`n"
111+ # Check if this is a manual trigger
112+ if ("${{ github.event_name }}" -eq "workflow_dispatch") {
113+ $changelog = "${{ github.event.inputs.changelog }}"
114+ if ($changelog) {
115+ # Split by " - " if multiple items
116+ $parts = $changelog -split " - "
117+ $formattedLog = ""
118+ foreach ($part in $parts) {
119+ $part = $part.Trim()
120+ if ($part) {
121+ $formattedLog += "- $part`n"
122+ }
123+ }
124+ $changelog = $formattedLog
125+ } else {
126+ $changelog = "- Manual release"
127+ }
128+ echo "Manual trigger changelog"
129+ } else {
130+ # Extract from commit message
131+ $msg = "${{ github.event.head_commit.message }}"
132+ $parts = $msg -split " - "
133+ $changelog = ""
134+ foreach ($part in $parts) {
135+ if ($part -match "^release:") { continue }
136+ $changelog += "- $part`n"
137+ }
138+ if (-not $changelog) {
139+ $changelog = $msg
140+ }
69141 }
70142
71- if (-not $changelog) {
72- # Fallback if split didn't find " - "
73- $changelog = $msg
74- }
75-
76- # Escape newlines for GitHub Actions output
143+ # Escape for GitHub Actions output
77144 $changelog = $changelog -replace '%', '%25' -replace '\n', '%0A' -replace '\r', '%0D'
78145 echo "LOGS=$changelog" >> $env:GITHUB_OUTPUT
79146
@@ -85,7 +152,17 @@ jobs:
85152 body : |
86153 ## Changes
87154 ${{ steps.changelog.outputs.LOGS }}
155+
156+ ## Installation
157+ 1. Download `SteamLuaPatcher-Windows.zip`
158+ 2. Extract the archive
159+ 3. Run `SteamLuaPatcher.exe`
160+
161+ ## Requirements
162+ - Windows 10/11
163+ - Visual C++ Redistributable (usually pre-installed)
88164 files : |
165+ SteamLuaPatcher-Windows.zip
89166 dist/SteamLuaPatcher.exe
90167 draft : false
91168 prerelease : false
0 commit comments