Skip to content

Commit 416de8e

Browse files
matej21claude
andcommitted
fix: install rcedit in isolated temp dir to avoid workspace conflict
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e66c28b commit 416de8e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,24 @@ jobs:
118118
if: runner.os == 'Windows'
119119
shell: pwsh
120120
run: |
121-
npm install --no-save rcedit png-to-ico
122121
$buildDir = "build/${{ needs.prepare.outputs.electrobun-env }}-${{ matrix.platform }}"
123122
$appDir = Get-ChildItem -Path $buildDir -Directory -Filter "Dotaz*" | Select-Object -First 1
124-
$rcedit = Join-Path (Get-Location) "node_modules\rcedit\bin\rcedit-x64.exe"
125-
$iconPng = Join-Path (Get-Location) "assets\icon.png"
123+
$iconPng = Resolve-Path "assets\icon.png"
124+
125+
# Install rcedit and png-to-ico in isolated temp dir (avoids workspace:* conflict)
126+
$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) "icon-tools"
127+
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
128+
Push-Location $tempDir
129+
npm init -y | Out-Null
130+
npm install rcedit png-to-ico --silent
131+
Pop-Location
132+
133+
# Convert PNG to ICO
126134
$iconIco = Join-Path $buildDir "app-icon.ico"
127-
npx png-to-ico $iconPng > $iconIco
135+
node -e "const p=require('$($tempDir -replace '\\','/')'+'/node_modules/png-to-ico');const fs=require('fs');p('$($iconPng -replace '\\','/')').then(b=>fs.writeFileSync('$($iconIco -replace '\\','/')',b))"
136+
137+
# Embed icon into executables and copy .ico for shortcuts
138+
$rcedit = Join-Path $tempDir "node_modules\rcedit\bin\rcedit-x64.exe"
128139
& $rcedit "$($appDir.FullName)\bin\launcher.exe" --set-icon $iconIco
129140
& $rcedit "$($appDir.FullName)\bin\bun.exe" --set-icon $iconIco
130141
Copy-Item $iconIco "$($appDir.FullName)\Resources\app.ico"

0 commit comments

Comments
 (0)