Prepare 0.1.42 macOS Apple silicon release
This commit is contained in:
@@ -21,5 +21,6 @@ export function packageTarget(args, defaults = process) {
|
||||
}
|
||||
|
||||
export function executableName(platform) {
|
||||
if (platform === 'darwin') return 'RuneStone-Browser.app/Contents/MacOS/RuneStone-Browser';
|
||||
return platform === 'win32' ? 'RuneStone-Browser.exe' : 'RuneStone-Browser';
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export async function stageRuntime({ project, host, platform, arch }) {
|
||||
let backup;
|
||||
let moved = false;
|
||||
try {
|
||||
await cp(source, staged, { recursive: true });
|
||||
await cp(source, staged, { recursive: true, verbatimSymlinks: true });
|
||||
// Electron Packager can leave its temporary root at 0700. Installed resources
|
||||
// must remain traversable after the package manager changes ownership to root.
|
||||
if (platform === 'linux') await chmod(staged, 0o755);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { mkdtemp, mkdir, writeFile, readFile, readdir, chmod, rm, stat } from 'node:fs/promises';
|
||||
import { mkdtemp, mkdir, writeFile, readFile, readdir, chmod, rm, stat, symlink, rename } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { stageRuntime } from '../scripts/stage-runtime.mjs';
|
||||
@@ -37,6 +37,26 @@ test('missing source leaves the previous runtime intact', async t => {
|
||||
assert.equal(await readFile(join(options.destination, 'RuneStone-Browser.exe'), 'utf8'), 'old runtime');
|
||||
});
|
||||
|
||||
test('macOS staging preserves the app bundle and executable layout', async t => {
|
||||
const options = await fixture(t);
|
||||
const source = join(options.project, 'dist/RuneStone-Browser-darwin-arm64');
|
||||
const executable = 'RuneStone-Browser.app/Contents/MacOS/RuneStone-Browser';
|
||||
await mkdir(join(source, 'RuneStone-Browser.app/Contents/MacOS'), { recursive: true });
|
||||
await writeFile(join(source, executable), 'macOS fixture', { mode: 0o755 });
|
||||
await writeFile(join(source, 'RuneStone-Browser.app/Contents/Info.plist'), 'bundle metadata');
|
||||
if (process.platform !== 'win32') {
|
||||
await symlink('../Info.plist', join(source, 'RuneStone-Browser.app/Contents/MacOS/metadata'));
|
||||
}
|
||||
const result = await stageRuntime({ ...options, platform: 'darwin', arch: 'arm64' });
|
||||
await rename(source, `${source}-moved`);
|
||||
assert.equal(await readFile(join(result.destination, executable), 'utf8'), 'macOS fixture');
|
||||
assert.equal(await readFile(join(result.destination, 'RuneStone-Browser.app/Contents/Info.plist'), 'utf8'), 'bundle metadata');
|
||||
assert.equal(await readFile(join(result.backup, 'RuneStone-Browser.exe'), 'utf8'), 'old runtime');
|
||||
if (process.platform !== 'win32') {
|
||||
assert.equal(await readFile(join(result.destination, 'RuneStone-Browser.app/Contents/MacOS/metadata'), 'utf8'), 'bundle metadata');
|
||||
}
|
||||
});
|
||||
|
||||
test('Linux staging rejects a non-executable runtime before replacing the old tree', { skip: process.platform === 'win32' }, async t => {
|
||||
const options = await fixture(t);
|
||||
await chmod(join(options.source, 'RuneStone-Browser'), 0o644);
|
||||
|
||||
Reference in New Issue
Block a user