Skip to content

Commit db2d773

Browse files
committed
Fix Windows release asset upload
1 parent e94c98d commit db2d773

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

.github/workflows/desktop-release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,33 @@ jobs:
197197
env:
198198
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
199199

200-
- name: Upload Release Asset
200+
- name: Find Windows Artifact
201+
if: contains(matrix.config.goos, 'windows')
202+
id: win_artifact
203+
shell: pwsh
204+
run: |
205+
$buildDir = Join-Path $env:GITHUB_WORKSPACE "repo\siyuan\app\build"
206+
$file = Get-ChildItem -Path $buildDir -Filter "siyuan-*-win.exe" -File | Select-Object -First 1
207+
if (-not $file) {
208+
Write-Error "Windows artifact not found in $buildDir"
209+
exit 1
210+
}
211+
"path=$($file.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
212+
"name=$($file.Name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
213+
214+
- name: Upload Release Asset (Windows)
215+
if: contains(matrix.config.goos, 'windows')
216+
uses: shogo82148/actions-upload-release-asset@v1
217+
env:
218+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
219+
with:
220+
upload_url: ${{ steps.get_release.outputs.upload_url }}
221+
asset_name: ${{ steps.win_artifact.outputs.name }}
222+
asset_path: ${{ steps.win_artifact.outputs.path }}
223+
asset_content_type: application/octet-stream
224+
225+
- name: Upload Release Asset (Non-Windows)
226+
if: "!contains(matrix.config.goos, 'windows')"
201227
uses: shogo82148/actions-upload-release-asset@v1
202228
env:
203229
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)