fix(release): exclude unpacked app from dev artifacts

Keep development desktop artifacts limited to distributable archives and update
metadata so macOS workflow downloads do not duplicate the packaged app bundle.
The package smoke step still validates the unpacked app before upload.

Tested: bun test scripts/pr/release-workflow.test.ts
Tested: bun run check:policy
Confidence: high
Scope-risk: narrow
This commit is contained in:
程序员阿江(Relakkes) 2026-06-03 21:23:35 +08:00
parent d7eef0ea51
commit dc5ab1e492
2 changed files with 17 additions and 4 deletions

View File

@ -121,10 +121,10 @@ jobs:
run: |
STAGING="desktop/build-artifacts/ci-Claude-Code-Haha-v${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}"
mkdir -p "$STAGING"
find desktop/build-artifacts/electron -maxdepth 2 \
\( -type f \( -name "*.dmg" -o -name "*.exe" -o -name "*.deb" -o -name "*.AppImage" -o -name "*.zip" -o -name "*.blockmap" -o -name "*.yml" \) \) -o \
\( -type d -name "*.app" \) | while read -r artifact; do
cp -R "$artifact" "$STAGING/"
find desktop/build-artifacts/electron -maxdepth 1 -type f \
\( -name "*.dmg" -o -name "*.exe" -o -name "*.deb" -o -name "*.AppImage" -o -name "*.zip" -o -name "*.blockmap" -o -name "*.yml" \) \
| while read -r artifact; do
cp -f "$artifact" "$STAGING/"
done
echo "staging_dir=$STAGING" >> "$GITHUB_OUTPUT"
ls -lh "$STAGING/" 2>/dev/null || true

View File

@ -47,6 +47,19 @@ describe('release desktop workflow', () => {
}
})
test('development desktop artifacts exclude unpacked macOS app bundles', () => {
const workflow = readFileSync('.github/workflows/build-desktop-dev.yml', 'utf8')
const collectStep = workflow.match(
/- name: Collect artifacts[\s\S]*?(?:\n\s{6}- name:|$)/,
)?.[0]
expect(collectStep).toContain('*.dmg')
expect(collectStep).toContain('*.zip')
expect(collectStep).toContain('*.blockmap')
expect(collectStep).toContain('*.yml')
expect(collectStep).not.toContain('-type d -name "*.app"')
})
test('desktop package includes Linux deb metadata required by electron-builder', () => {
const desktopPackage = JSON.parse(readFileSync('desktop/package.json', 'utf8')) as {
description?: string