CI/CD / preconditions (pull_request) Successful in 2s
Native JavaScript checks / Native launcher and release tests (pull_request) Successful in 1m0s
CI/CD / test_and_check_app (pull_request) Successful in 7m2s
CI/CD / Publish immutable image (pull_request) Skipped
macOS checks / Native Rust tests and unsigned build (pull_request) Successful in 1m35s
26 lines
817 B
JavaScript
26 lines
817 B
JavaScript
import { mkdirSync, rmSync, symlinkSync } from 'node:fs';
|
|
import { dirname, join } from 'node:path';
|
|
|
|
export function createDiskImage({ app, archive, identity, run }) {
|
|
const contents = join(dirname(archive), 'dmg-contents');
|
|
mkdirSync(contents);
|
|
try {
|
|
run('ditto', [app, join(contents, 'KanbanGit.app')]);
|
|
symlinkSync('/Applications', join(contents, 'Applications'));
|
|
run('hdiutil', [
|
|
'create',
|
|
'-volname',
|
|
'KanbanGit',
|
|
'-srcfolder',
|
|
contents,
|
|
'-format',
|
|
'UDZO',
|
|
archive,
|
|
]);
|
|
run('codesign', ['--sign', identity, '--timestamp', archive]);
|
|
run('hdiutil', ['verify', archive]);
|
|
} finally {
|
|
rmSync(contents, { recursive: true, force: true });
|
|
}
|
|
}
|