Skip to content

Commit 33079fb

Browse files
authored
Merge pull request #16 from criptogus/fix/windows-release-asset-name
fix: keep Windows installer URLs consistent with published assets
2 parents 69a613f + 2869b3e commit 33079fb

4 files changed

Lines changed: 33 additions & 0 deletions

File tree

‎.agents/skills/release-validation/SKILL.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ Run from the repository root. Never trigger a release or create a tag merely to
1212
5. After opening the PR, inspect checks for its current commit. A failure or missing report is not success. Publication and merge require the user's existing authorization; this skill grants neither.
1313

1414
Use the existing checker and smoke scripts; do not duplicate them. See `docs/RELEASE-VALIDATION.md` for scope and limitations.
15+
16+
After a continuous release, check the current commit in the release body, successful validation/build/publish ordering, nonempty uploaded assets, and every `latest*.yml` file URL against the literal published asset name and size. Download manifest files to verify their GitHub digest, and verify installer SHA-512 before repairing a manifest. A green publisher job alone does not prove updater URLs work. Never silently normalize mismatching names; an HTTP 404 is a failure. Record repairs separately from the original workflow run.

‎electron-builder.corp.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ mac:
2929
target:
3030
- dmg
3131
- zip
32+
nsis:
33+
# Keep the physical filename identical to the update manifest and GitHub asset.
34+
artifactName: KeepMind-Corp-Setup-${version}.${ext}
3235
win:
3336
target:
3437
- nsis

‎electron-builder.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ mac:
2121
target:
2222
- dmg
2323
- zip
24+
nsis:
25+
# Keep the physical filename identical to the update manifest and GitHub asset.
26+
artifactName: KeepMind-Setup-${version}.${ext}
2427
win:
2528
target:
2629
- nsis
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { readFileSync } from 'node:fs'
3+
import { createRequire } from 'node:module'
4+
const require = createRequire(import.meta.url)
5+
require('app-builder-lib') // Initialize its public entrypoint before internal helpers.
6+
const { load } = require('js-yaml')
7+
const { expandMacro } = require('app-builder-lib/out/util/macroExpander')
8+
const { computeSafeArtifactNameIfNeeded } = require('app-builder-lib/out/platformPackager')
9+
const { NsisTarget } = require('app-builder-lib/out/targets/nsis/NsisTarget')
10+
const defaultPattern = Object.getOwnPropertyDescriptor(NsisTarget.prototype, 'installerFilenamePattern')!.get!.call({ isPortable: false })
11+
const expand = (pattern: string, productName: string) => expandMacro(pattern, 'x64', { productName, version: '0.2.6' }, { ext: 'exe' }, false)
12+
13+
describe('Windows installer names used by external GitHub publication', () => {
14+
it('reproduces the default NSIS filename/manifest mismatch', () => {
15+
const filename = expand(defaultPattern, 'KeepMind')
16+
expect(filename).toBe('KeepMind Setup 0.2.6.exe')
17+
expect(computeSafeArtifactNameIfNeeded(filename, () => '')).toBe('KeepMind-Setup-0.2.6.exe')
18+
})
19+
it.each(['electron-builder.yml', 'electron-builder.corp.yml'])('%s produces the same on-disk and update-manifest filename', file => {
20+
const config = load(readFileSync(file, 'utf8'))
21+
const filename = expand(config.nsis?.artifactName ?? defaultPattern, config.productName)
22+
expect(filename).toMatch(/^[A-Za-z0-9._-]+\.exe$/)
23+
expect(computeSafeArtifactNameIfNeeded(filename, () => '')).toBeNull()
24+
})
25+
})

0 commit comments

Comments
 (0)