add universal package for macOS

This commit is contained in:
cutls 2022-12-08 02:52:28 +09:00
parent 704d235feb
commit 29d6146e02
4 changed files with 17 additions and 31 deletions

1
app/build.d.ts vendored
View File

@ -10,5 +10,6 @@ declare function _exports(options?: {
skipLinux?: boolean; skipLinux?: boolean;
skipMacOS?: boolean; skipMacOS?: boolean;
unnotarize?: boolean; unnotarize?: boolean;
skipUniversal?: boolean;
}): void; }): void;
export = _exports; export = _exports;

View File

@ -177,36 +177,22 @@ async function cmd(options) {
if (isTrue(options, 'unnotarize')) delete config.mac.entitlements if (isTrue(options, 'unnotarize')) delete config.mac.entitlements
if (isTrue(options, 'unnotarize')) delete config.mac.entitlementsInherit if (isTrue(options, 'unnotarize')) delete config.mac.entitlementsInherit
if (isTrue(options, 'unnotarize')) process.env.CSC_IDENTITY_AUTO_DISCOVERY = false if (isTrue(options, 'unnotarize')) process.env.CSC_IDENTITY_AUTO_DISCOVERY = false
if (arch === 'x64') { if (isTrue(options, 'unnotarize')) delete config.afterSign
if (!isTrue(options, 'skipX64')) { if (!isTrue(options, 'skipUniversal')) await build(Platform.MAC, Arch.universal, config)
await build(Platform.MAC, Arch.x64, config) if (isTrue(options, 'withArm64')) {
fs.renameSync(
`../build/TheDesk-${version}.dmg`,
`../build/TheDesk-${version}-x64.dmg`
)
}
if (isTrue(options, 'withArm64')) {
await build(Platform.MAC, Arch.arm64, config)
fs.renameSync(
`../build/TheDesk-${version}.dmg`,
`../build/TheDesk-${version}-arm64.dmg`
)
}
fs.renameSync(
`../build/TheDesk-${version}-x64.dmg`,
`../build/TheDesk-${version}.dmg`
)
}
if (arch === 'arm64') {
if (isTrue(options, 'unnotarize')) delete config.afterSign
await build(Platform.MAC, Arch.arm64, config) await build(Platform.MAC, Arch.arm64, config)
fs.renameSync( fs.renameSync(
`../build/TheDesk-${version}.dmg`, `../build/TheDesk-${version}.dmg`,
`../build/TheDesk-${version}-arm64.dmg` `../build/TheDesk-${version}-arm64.dmg`
) )
if (!isTrue(options, 'skipX64')) await build(Platform.MAC, Arch.x64, config)
} }
if (isTrue(options, 'withX64')) {
await build(Platform.MAC, Arch.x64, config)
fs.renameSync(
`../build/TheDesk-${version}.dmg`,
`../build/TheDesk-${version}-x64.dmg`
)
}
} }
} }
} }
@ -246,6 +232,10 @@ TheDesk Builder command tool
[only macOS] [only macOS]
--unnotarize: Without notarize --unnotarize: Without notarize
Build as a "universal" package.
--skipUniversal: skip build for universal enviroment
--withX64: build x64-only build
--withArm64: build arm64-only build
` `
} }

View File

@ -18,7 +18,7 @@
"build": "node buildCli.js", "build": "node buildCli.js",
"build:pwa": "node view/make/makeCli.js --pwa", "build:pwa": "node view/make/makeCli.js --pwa",
"build:all:x64": "node buildCli.js --withStore", "build:all:x64": "node buildCli.js --withStore",
"build:all": "node buildCli.js --withStore --withIa32 --withArm64", "build:all": "node buildCli.js --withStore --withX64 --withIa32 --withArm64",
"lint:fix": "eslint js --fix", "lint:fix": "eslint js --fix",
"lint": "eslint js" "lint": "eslint js"
}, },

View File

@ -97,8 +97,7 @@
<button class="waves-effect btn linux hide" onclick="update('linux')" style="margin-left: 15px;">@@linux@@</button> <button class="waves-effect btn linux hide" onclick="update('linux')" style="margin-left: 15px;">@@linux@@</button>
<button class="waves-effect btn linux hide" onclick="update('linuxdeb')" style="margin-left: 15px;">@@linuxdeb@@</button> <button class="waves-effect btn linux hide" onclick="update('linuxdeb')" style="margin-left: 15px;">@@linuxdeb@@</button>
<button class="waves-effect btn linux hide" onclick="update('linuxsnap')" style="margin-left: 15px;">@@linuxsnap@@</button> <button class="waves-effect btn linux hide" onclick="update('linuxsnap')" style="margin-left: 15px;">@@linuxsnap@@</button>
<button class="waves-effect btn mac hide" onclick="update('mac')" style="margin-left: 15px;">@@download@@(Intel Mac)</button> <button class="waves-effect btn mac hide" onclick="update('mac')" style="margin-left: 15px;">@@download@@</button>
<button class="waves-effect btn mac hide" onclick="update('macarm64')" style="margin-left: 15px;">@@download@@(M1 Mac)</button>
<br /> <br />
@@problem1@@<br />@@problem2@@ @@problem1@@<br />@@problem2@@
</div> </div>
@ -221,10 +220,6 @@
var url = json['mac'] var url = json['mac']
var file = 'TheDesk-' + json.unique_mac + '.dmg' var file = 'TheDesk-' + json.unique_mac + '.dmg'
var filesize = json.mac_size var filesize = json.mac_size
} else if (sel == 'macarm64') {
var url = json['macarm64']
var file = 'TheDesk-' + json.unique_mac + '.dmg'
var filesize = json.macarm64_size
} }
postMessage(['downloadButton', [url, file, filesize]], '*') postMessage(['downloadButton', [url, file, filesize]], '*')
}) })