fix(ci): re-calculate Windows artifact hash
Authored-by-agent: Codex <267193182+codex@users.noreply.github.com>
This commit is contained in:
@@ -265,6 +265,15 @@ jobs:
|
||||
path: apps/stage-tamagotchi/bundle/signed/windows/${{ env.BUNDLE_NAME }}
|
||||
overwrite: true
|
||||
|
||||
# NOTICE: Electron Builder generates latest.yml during the build step, before this workflow
|
||||
# submits the Windows installer to SignPath. SignPath re-signs the .exe and changes its bytes,
|
||||
# which changes the updater hashes too. Regenerating latest.yml from the signed installer keeps
|
||||
# the published Windows update metadata aligned with the final released artifact.
|
||||
- name: Regenerate Windows latest.yml (Nightly + Windows Only)
|
||||
if: ${{ github.event_name == 'schedule' && matrix.os == 'windows-latest' }}
|
||||
run: |
|
||||
pnpm -F @proj-airi/stage-tamagotchi run regenerate-windows-latest --input apps/stage-tamagotchi/bundle/signed/windows/${{ env.BUNDLE_NAME }} --output apps/stage-tamagotchi/bundle/latest.yml --version ${{ env.VERSION }}
|
||||
|
||||
# ---------
|
||||
# Workflow Dispatch only
|
||||
# ---------
|
||||
@@ -358,6 +367,14 @@ jobs:
|
||||
path: apps/stage-tamagotchi/bundle/${{ env.BUNDLE_NAME }}
|
||||
overwrite: true
|
||||
|
||||
# NOTICE: Electron Builder already wrote latest.yml before SignPath signed the installer.
|
||||
# After the signed .exe replaces the unsigned one, we must rebuild latest.yml so its hashes
|
||||
# describe the final Windows artifact that users will actually download.
|
||||
- name: Regenerate Windows latest.yml (Manual + Windows Only)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.build_only && inputs.artifacts_only && matrix.os == 'windows-latest' }}
|
||||
run: |
|
||||
pnpm -F @proj-airi/stage-tamagotchi run regenerate-windows-latest --input apps/stage-tamagotchi/bundle/${{ env.BUNDLE_NAME }} --output apps/stage-tamagotchi/bundle/latest.yml --version ${{ env.VERSION }}
|
||||
|
||||
- name: Upload To GitHub Releases (Manual + Release + Overwrite Release)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.build_only && !inputs.artifacts_only }}
|
||||
uses: softprops/action-gh-release@v2
|
||||
@@ -426,6 +443,15 @@ jobs:
|
||||
run: |
|
||||
Move-Item -Force apps/stage-tamagotchi/bundle/signed/windows/${{ env.BUNDLE_NAME }} apps/stage-tamagotchi/bundle/${{ env.BUNDLE_NAME }}
|
||||
|
||||
# NOTICE: The root cause here is the build/signing order: latest.yml is produced by Electron
|
||||
# Builder before SignPath re-signs the installer. That post-build signing step mutates the .exe,
|
||||
# so the updater metadata becomes stale. Recomputing latest.yml after the signed file is moved
|
||||
# into its final bundle path makes the release upload self-consistent again.
|
||||
- name: Regenerate Windows latest.yml (Automatic + Windows Only)
|
||||
if: ${{ github.event_name == 'release' && matrix.os == 'windows-latest' }}
|
||||
run: |
|
||||
pnpm -F @proj-airi/stage-tamagotchi run regenerate-windows-latest --input apps/stage-tamagotchi/bundle/${{ env.BUNDLE_NAME }} --output apps/stage-tamagotchi/bundle/latest.yml --version ${{ env.VERSION }}
|
||||
|
||||
- name: Upload To GitHub Releases (Automatic)
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
||||
Reference in New Issue
Block a user