diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e323d0..a88f8c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,9 +23,9 @@ jobs: build_command: npx electron-builder --publish never --win --x64 artifact_name: windows-x64-artifacts - os: windows-latest - display_name: Windows ia32 + display_name: Windows win32 build_command: npx electron-builder --publish never --win --ia32 - artifact_name: windows-ia32-artifacts + artifact_name: windows-win32-artifacts - os: ubuntu-latest display_name: Linux x64 build_command: npx electron-builder --publish never --linux --x64 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b34f1d..56abe88 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,9 +29,9 @@ jobs: build_command: npx electron-builder --publish never --win --x64 artifact_name: windows-x64-artifacts - os: windows-latest - display_name: Windows ia32 + display_name: Windows win32 build_command: npx electron-builder --publish never --win --ia32 - artifact_name: windows-ia32-artifacts + artifact_name: windows-win32-artifacts - os: ubuntu-latest display_name: Linux x64 build_command: npx electron-builder --publish never --linux --x64 @@ -121,26 +121,30 @@ jobs: fi fi - # --- Windows (ia32) --- - if [[ -d artifacts/windows-ia32-artifacts ]]; then - for file in artifacts/windows-ia32-artifacts/*.exe; do + # --- Windows (win32) --- + if [[ -d artifacts/windows-win32-artifacts ]]; then + for file in artifacts/windows-win32-artifacts/*.exe; do base="$(basename "$file")" target="$base" - if [[ "$base" != *-ia32.exe ]]; then - target="${base%.exe}-ia32.exe" + if [[ "$base" == *-ia32* ]]; then + target="${base//-ia32/-win32}" + elif [[ "$base" != *-win32.exe ]]; then + target="${base%.exe}-win32.exe" fi cp "$file" "release_upload/$target" done - for file in artifacts/windows-ia32-artifacts/*.exe.blockmap; do + for file in artifacts/windows-win32-artifacts/*.exe.blockmap; do base="$(basename "$file")" target="$base" - if [[ "$base" != *-ia32.exe.blockmap ]]; then - target="${base/.exe/-ia32.exe}" + if [[ "$base" == *-ia32* ]]; then + target="${base//-ia32/-win32}" + elif [[ "$base" != *-win32.exe.blockmap ]]; then + target="${base/.exe/-win32.exe}" fi cp "$file" "release_upload/$target" done - if [[ -f artifacts/windows-ia32-artifacts/latest.yml ]]; then - cp artifacts/windows-ia32-artifacts/latest.yml release_upload/latest-ia32.yml + if [[ -f artifacts/windows-win32-artifacts/latest.yml ]]; then + cp artifacts/windows-win32-artifacts/latest.yml release_upload/latest-win32.yml fi fi diff --git a/tests/autoUpdateHelpers.test.ts b/tests/autoUpdateHelpers.test.ts index 2763b5e..f2672fe 100644 --- a/tests/autoUpdateHelpers.test.ts +++ b/tests/autoUpdateHelpers.test.ts @@ -13,7 +13,7 @@ import { test('detectArchFromFileName recognises common Windows architectures', () => { assert.equal(detectArchFromFileName('app-setup-x64.exe'), 'x64'); - assert.equal(detectArchFromFileName('app-setup-ia32.exe'), 'ia32'); + assert.equal(detectArchFromFileName('app-setup-win32.exe'), 'ia32'); assert.equal(detectArchFromFileName('APP-X86.msi'), 'ia32'); assert.equal(detectArchFromFileName('build-aarch64.zip'), 'arm64'); assert.equal(detectArchFromFileName('installer-armhf.tar.gz'), 'armv7l'); @@ -50,7 +50,7 @@ const createUpdateInfo = (overrides: Partial): UpdateDown test('extractCandidateNamesFromUpdateInfo aggregates filenames from multiple sources', () => { const info = createUpdateInfo({ files: [ - { url: 'https://example.com/app-ia32.exe' } as any, + { url: 'https://example.com/app-win32.exe' } as any, { url: 'https://example.com/app-x64.exe?raw=1' } as any, ], path: '/tmp/legacy/App-x64.exe', @@ -59,11 +59,11 @@ test('extractCandidateNamesFromUpdateInfo aggregates filenames from multiple sou const candidates = extractCandidateNamesFromUpdateInfo(info, '.exe'); const sorted = [...candidates].sort(); - assert.deepEqual(sorted, ['App-x64.exe', 'app-ia32.exe', 'app-x64.exe']); + assert.deepEqual(sorted, ['App-x64.exe', 'app-win32.exe', 'app-x64.exe']); }); test('filterNamesByArch prefers matches but falls back when none exist', () => { - const names = ['app-ia32.exe', 'app-x64.exe']; + const names = ['app-win32.exe', 'app-x64.exe']; assert.deepEqual(filterNamesByArch(names, 'x64'), ['app-x64.exe']); assert.deepEqual(filterNamesByArch(names, 'arm64'), names); assert.deepEqual(filterNamesByArch(names, null), names); @@ -72,7 +72,7 @@ test('filterNamesByArch prefers matches but falls back when none exist', () => { test('determineDownloadedUpdateArch prioritises metadata that matches the downloaded file', () => { const info = createUpdateInfo({ files: [ - { url: 'https://example.com/app-1.2.3-windows-ia32-setup.exe' } as any, + { url: 'https://example.com/app-1.2.3-windows-win32-setup.exe' } as any, { url: 'https://example.com/app-1.2.3-windows-x64-setup.exe' } as any, ], downloadedFile: '/tmp/app-1.2.3-windows-x64-setup.exe',