1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-07-30 22:07:01 +00:00

Initial Mac packaging setup

This commit is contained in:
Michael Hollister 2024-10-04 17:13:36 -05:00
parent fa065b3a3b
commit fe9cc7a398
18 changed files with 759 additions and 71 deletions

View file

@ -1,14 +1,19 @@
const fs = require('fs');
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
const argv = yargs(hideBin(process.argv)).argv;
module.exports = {
packagerConfig: {
asar: true,
osxSign: {
// "identity": process.env.FCAST_APPLE_SIGN_ID
},
icon: './assets/icons/icon',
name: 'FCast Receiver',
osxSign: {},
osxNotarize: {
// keychainProfile: "codesign"
appleApiKey: process.env.FCAST_APPLE_API_KEY,
appleApiKeyId: process.env.FCAST_APPLE_API_KEY_ID,
appleApiIssuer: process.env.FCAST_APPLE_API_ISSUER
@ -20,9 +25,37 @@ module.exports = {
// name: '@electron-forge/maker-squirrel',
// config: {},
// },
{
name: '@electron-forge/maker-dmg',
config: {
additionalDMGOptions: {
window: {
position: {
x: 425,
y: 275
},
size: {
width: 640,
height: 480
}
}
},
background: './assets/images/background.png',
contents: [
{ 'x': 90, 'y': 350, 'type': 'file', 'path': `out/FCast Receiver-darwin-${argv.arch}/FCast Receiver.app` },
{ 'x': 360, 'y': 350, 'type': 'link', 'path': '/Applications' },
{ 'x': 0, 'y': 540, 'type': 'position', 'path': '.background' },
{ 'x': 120, 'y': 540, 'type': 'position', 'path': '.VolumeIcon.icns' }
],
format: 'ULFO',
icon: './assets/icons/icon.icns',
name: 'FCast Receiver'
}
},
{
name: '@electron-forge/maker-zip',
platforms: ['win32', 'darwin', 'linux'],
config: {}
},
// {
@ -34,6 +67,39 @@ module.exports = {
// config: {},
// },
],
hooks: {
postMake: async (forgeConfig, makeResults) => {
makeResults.forEach(e => {
// Standardize artifact output naming
switch (e.platform) {
case "win32":
break;
case "darwin": {
let artifactName = 'FCast Receiver.dmg';
if (fs.existsSync(`./out/make/${artifactName}`)) {
fs.renameSync(`./out/make/${artifactName}`, `./out/make/FCast-Receiver-${e.packageJSON.version}-macOS-${e.arch}.dmg`);
}
artifactName = 'FCast Receiver-darwin-arm64-1.0.14.zip';
if (fs.existsSync(`./out/make/zip/darwin/arm64/${artifactName}`)) {
fs.renameSync(`./out/make/zip/darwin/arm64/${artifactName}`, `./out/make/zip/darwin/arm64/FCast-Receiver-${e.packageJSON.version}-macOS-${e.arch}.zip`);
}
artifactName = 'FCast Receiver-darwin-x64-1.0.14.zip';
if (fs.existsSync(`./out/make/zip/darwin/x64/${artifactName}`)) {
fs.renameSync(`./out/make/zip/darwin/x64/${artifactName}`, `./out/make/zip/darwin/x64/FCast-Receiver-${e.packageJSON.version}-macOS-${e.arch}.zip`);
}
break;
}
case "linux":
break;
default:
break;
}
});
}
},
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',