Skip to content

Commit

Permalink
feat: add build target for darwin arm64 (apple silicon)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebiggz committed Jan 24, 2025
1 parent 58c152e commit 1a2fc31
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/release-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- Download and run Firebot-v{0}-setup.exe

## MacOS Install
- Download Firebot-v{0}-macos-x64.dmg
- Download Firebot-v{0}-macos-arm64.dmg (Apple Silicon) or Firebot-v{0}-macos-x64.dmg (Intel Macs)
- Right click the .dmg and select "Open"
- In the dialog that appears click "Cancel"
- Right click the .dmg again and select "Open"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/compile-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,4 @@ jobs:
./bundles/Windows/RELEASES
./bundles/Linux/firebot-v${{ needs.checkversion.outputs.version }}-linux-x64.tar.gz
./bundles/macOS/firebot-v${{ needs.checkversion.outputs.version }}-macos-x64.dmg
./bundles/macOS/firebot-v${{ needs.checkversion.outputs.version }}-macos-arm64.dmg
22 changes: 13 additions & 9 deletions grunt/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const createWindowsInstaller = require('electron-winstaller').createWindowsInsta

module.exports = function (grunt) {

const macPathIn = path.resolve(__dirname, `../dist/pack/Firebot-darwin-x64/Firebot.app`);
const macIntelPathIn = path.resolve(__dirname, `../dist/pack/Firebot-darwin-x64/Firebot.app`);
const macArmPathIn = path.resolve(__dirname, `../dist/pack/Firebot-darwin-arm64/Firebot.app`);
const macPathOut = path.resolve(__dirname, '../dist/install/darwin');
const macDmgIcon = path.resolve(__dirname, `../build/gui/images/logo_transparent_2.png`);
const macDmgBg = path.resolve(__dirname, `../build/gui/images/firebot_dmg_bg.png`);
Expand Down Expand Up @@ -55,29 +56,32 @@ module.exports = function (grunt) {
}
},
shell: {
'compile-darwin': {
command: `npx --no-install electron-installer-dmg "${macPathIn}" firebot-v${version}-macos-x64 --out="${macPathOut}" --background="${macDmgBg}" --icon="${macDmgIcon}" --title="Firebot Installer" --debug`
'compile-darwin-x64': {
command: `npx --no-install electron-installer-dmg "${macIntelPathIn}" firebot-v${version}-macos-x64 --out="${macPathOut}" --background="${macDmgBg}" --icon="${macDmgIcon}" --title="Firebot Installer" --debug`
},
'compile-darwin-arm64': {
command: `npx --no-install electron-installer-dmg "${macArmPathIn}" firebot-v${version}-macos-arm64 --out="${macPathOut}" --background="${macDmgBg}" --icon="${macDmgIcon}" --title="Firebot Installer" --debug`
}
}
});

grunt.loadNpmTasks('grunt-contrib-compress');
let compileCommand;
let compileCommands = [];
switch (grunt.config.get('platform')) {
case 'win64':
compileCommand = 'create-windows-installer:win64';
compileCommands = ['create-windows-installer:win64'];
break;

case 'linux':
compileCommand = 'compress:linux';
compileCommands = ['compress:linux'];
break;

case 'darwin':
compileCommand = 'shell:compile-darwin';
compileCommands = ['shell:compile-darwin-x64', 'shell:compile-darwin-arm64'];
break;

default:
throw new Error('unknonw platform');
throw new Error('unknown platform');
}
grunt.registerTask('compile', ['cleanup:install', compileCommand]);
grunt.registerTask('compile', ['cleanup:install', ...compileCommands]);
};
2 changes: 1 addition & 1 deletion grunt/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = function (grunt) {
command: `npx --no-install @electron/packager . Firebot --platform=win32 ${flags} --app-version=${windowsAppVersion}`
},
packdarwin: {
command: `npx --no-install @electron/packager . Firebot --platform=darwin ${flags} --extend-info="extra.plist" --extra-resource="./src/resources/firebot-setup-file-icon.icns"`
command: `npx --no-install @electron/packager . Firebot --platform=darwin ${flags} --arch=arm64 --extend-info="extra.plist" --extra-resource="./src/resources/firebot-setup-file-icon.icns"`
},
packlinux: {
command: `npx --no-install @electron/packager . Firebot --platform=linux ${flags}`
Expand Down

0 comments on commit 1a2fc31

Please sign in to comment.