Skip to content

Commit 01cddc3

Browse files
committed
Fix actions
1 parent f9cbb08 commit 01cddc3

2 files changed

Lines changed: 38 additions & 83 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 21 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -100,78 +100,32 @@ jobs:
100100
$ErrorActionPreference = 'Stop'
101101
cmake --build build --config ${{ env.BUILD_TYPE }}
102102
103-
- name: Install
104-
shell: pwsh
105-
run: |
106-
$ErrorActionPreference = 'Stop'
107-
$installDir = Join-Path "${{ github.workspace }}" "build\install"
108-
New-Item -ItemType Directory -Path $installDir -Force | Out-Null
109-
cmake --install build --config ${{ env.BUILD_TYPE }} --prefix "$installDir"
110-
$items = Get-ChildItem -Recurse $installDir
111-
if (-not $items) { Write-Error "Install directory is empty — check install() rules in CMakeLists.txt"; exit 1 }
112-
Write-Host "Install tree:"; $items | ForEach-Object { Write-Host $_.FullName }
113-
114-
- name: Copy Python bundle to install tree
115-
shell: pwsh
116-
run: |
117-
$ErrorActionPreference = 'Stop'
118-
$buildExe = Get-ChildItem -Path "build" -Filter "CapScriptPro.exe" -Recurse |
119-
Where-Object { $_.FullName -notlike "*install*" } |
120-
Select-Object -First 1
121-
if (-not $buildExe) { Write-Error "CapScriptPro.exe not found in build output"; exit 1 }
122-
$buildDir = $buildExe.DirectoryName
123-
$installDir = Join-Path "${{ github.workspace }}" "build\install"
124-
$srcPython = Join-Path $buildDir "python"
125-
$dstPython = Join-Path $installDir "python"
126-
if (Test-Path $srcPython) {
127-
Write-Host "Copying bundled Python from $srcPython to $dstPython"
128-
Copy-Item -Path $srcPython -Destination $dstPython -Recurse -Force
129-
} else {
130-
Write-Warning "No python bundle found at $srcPython — skipping"
131-
}
132-
133103
- name: Deploy Qt runtime
134104
shell: pwsh
135105
run: |
136106
$ErrorActionPreference = 'Stop'
137-
$exe = Get-ChildItem -Path "build\install" -Filter "CapScriptPro.exe" -Recurse | Select-Object -First 1
138-
if (-not $exe) { Write-Error "CapScriptPro.exe not found in install tree"; exit 1 }
107+
$exe = Get-ChildItem -Path "build" -Filter "CapScriptPro.exe" -Recurse | Select-Object -First 1
108+
if (-not $exe) { Write-Error "CapScriptPro.exe not found"; exit 1 }
139109
$windeployqt = Join-Path $env:QT_ROOT_DIR "bin\windeployqt.exe"
140110
if (-not (Test-Path $windeployqt)) { Write-Error "windeployqt not found at $windeployqt"; exit 1 }
141111
& $windeployqt $exe.FullName --no-translations --no-system-d3d-compiler --no-opengl-sw
142112
143-
- name: Create build archive
144-
shell: pwsh
145-
run: |
146-
$ErrorActionPreference = 'Stop'
147-
$ver = "${{ steps.version.outputs.VERSION }}"
148-
$buildExe = Get-ChildItem -Path "build" -Filter "CapScriptPro.exe" -Recurse |
149-
Where-Object { $_.FullName -notlike "*install*" } |
150-
Select-Object -First 1
151-
if (-not $buildExe) { Write-Error "CapScriptPro.exe not found in build output"; exit 1 }
152-
$buildDir = $buildExe.DirectoryName
153-
Compress-Archive -Path "$buildDir\*" -DestinationPath "CapScriptPro-Windows-x64-$ver-build.zip"
154-
155-
- name: Create installed archive
113+
- name: Stage build output
156114
shell: pwsh
157115
run: |
158116
$ErrorActionPreference = 'Stop'
159-
$ver = "${{ steps.version.outputs.VERSION }}"
160-
$installDir = Join-Path "${{ github.workspace }}" "build\install"
161-
if (-not (Test-Path $installDir)) { Write-Error "Install directory not found: $installDir"; exit 1 }
162-
Compress-Archive -Path "$installDir\*" -DestinationPath "CapScriptPro-Windows-x64-$ver-installed.zip"
163-
164-
- name: Upload build artifact
117+
$exe = Get-ChildItem -Path "build" -Filter "CapScriptPro.exe" -Recurse | Select-Object -First 1
118+
if (-not $exe) { Write-Error "CapScriptPro.exe not found"; exit 1 }
119+
$buildDir = $exe.DirectoryName
120+
New-Item -ItemType Directory -Path "staging" -Force | Out-Null
121+
Copy-Item -Path "$buildDir\*" -Destination "staging\" -Recurse -Force
122+
Write-Host "Staged files:"; Get-ChildItem -Recurse "staging" | ForEach-Object { Write-Host $_.FullName }
123+
124+
- name: Upload artifact
165125
uses: actions/upload-artifact@v4
166126
with:
167-
name: CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}-build
168-
path: CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}-build.zip
169-
170-
- name: Upload install artifact
171-
uses: actions/upload-artifact@v4
172-
with:
173-
name: CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}-installed
174-
path: CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}-installed.zip
127+
name: CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}
128+
path: staging/
175129

176130
release:
177131
needs: [build-windows]
@@ -186,13 +140,17 @@ jobs:
186140
187141
- uses: actions/download-artifact@v4
188142
with:
189-
merge-multiple: true
143+
name: CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}
144+
path: release-contents
145+
146+
- name: Create release zip
147+
run: |
148+
cd release-contents
149+
zip -r "../CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}.zip" .
190150
191151
- name: Create Release
192152
uses: softprops/action-gh-release@v2
193153
with:
194154
draft: true
195155
generate_release_notes: true
196-
files: |
197-
CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}-build.zip
198-
CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}-installed.zip
156+
files: CapScriptPro-Windows-x64-${{ steps.version.outputs.VERSION }}.zip

src/core/AutoUpdater.cpp

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,32 +115,29 @@ bool AutoUpdater::isVersionNewer(const QString &candidate,
115115

116116
AutoUpdater::AssetInfo
117117
AutoUpdater::pickBestAsset(const QJsonArray &assets) const {
118-
const QString platform = normalisedPlatformToken();
118+
const QString platform = normalisedPlatformToken();
119119

120-
AssetInfo firstZip;
120+
AssetInfo firstZip;
121121

122-
for (const auto &value : assets) {
123-
const QJsonObject asset = value.toObject();
124-
const QString name = asset.value("name").toString();
125-
const QString url = asset.value("browser_download_url").toString();
126-
const QString lowerName = name.toLower();
122+
for (const auto &value : assets) {
123+
const QJsonObject asset = value.toObject();
124+
const QString name = asset.value("name").toString();
125+
const QString url = asset.value("browser_download_url").toString();
126+
const QString lowerName = name.toLower();
127127

128-
if (!lowerName.endsWith("installed.zip") || url.isEmpty())
129-
continue;
130-
131-
if (firstZip.name.isEmpty()) {
132-
firstZip.name = name;
133-
firstZip.downloadUrl = url;
134-
}
128+
if (!lowerName.endsWith(".zip") || url.isEmpty())
129+
continue;
135130

136-
const bool looksPlatformSpecific =
137-
lowerName.contains(platform) || lowerName.contains("installed");
131+
if (firstZip.name.isEmpty()) {
132+
firstZip.name = name;
133+
firstZip.downloadUrl = url;
134+
}
138135

139-
if (looksPlatformSpecific && lowerName.contains(platform))
140-
return {name, url};
141-
}
136+
if (lowerName.contains(platform))
137+
return {name, url};
138+
}
142139

143-
return firstZip;
140+
return firstZip;
144141
}
145142

146143
void AutoUpdater::checkForUpdates(bool silentNoUpdate) {

0 commit comments

Comments
 (0)