Skip to content

Commit

Permalink
Add deb and rpm builds for distribution
Browse files Browse the repository at this point in the history
This adds the ability to generate rpm and deb packages as part of linux
distribution.  It takes advantage of other electron-installer based
providers while building an electron app.
  • Loading branch information
pcreech committed Nov 18, 2024
1 parent ffac786 commit 266eacf
Show file tree
Hide file tree
Showing 4 changed files with 670 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/compile-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ jobs:
name: ${{ runner.os }}
path: ./dist/install/${{ runner.os == 'macOS' && 'darwin' || runner.os }}/

- name: Upload RPM
if: runner.os == 'linux'
uses: actions/upload-artifact@v3
with:
name: RPM
path: ./dist/install/rpm/

- name: Upload DEB
if: runner.os == 'linux'
uses: actions/upload-artifact@v3
with:
name: DEB
path: ./dist/install/deb/

draft:
name: Draft Github Release
needs: [checkversion, compile]
Expand Down
20 changes: 14 additions & 6 deletions grunt/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,36 @@ 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-rpm': {
command: `npx --no-install electron-installer-redhat --src dist/pack/Firebot-linux-x64/ --dest dist/install/rpm/ --arch x86_64 --bin "Firebot v5"`
},
'compile-deb': {
command: `npx --no-install electron-installer-debian --src dist/pack/Firebot-linux-x64/ --dest dist/install/deb/ --arch x86_64 --bin "Firebot v5"`
}
}
});

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

case 'linux':
compileCommand = 'compress:linux';
compileCommands.push('compress:linux');
compileCommands.push('shell:compile-rpm');
compileCommands.push('shell:compile-deb');
break;

case 'darwin':
compileCommand = 'shell:compile-darwin';
compileCommands.push('shell:compile-darwin');
break;

default:
throw new Error('unknonw platform');
}
grunt.registerTask('compile', ['cleanup:install', compileCommand]);
};
grunt.registerTask('compile', compileCommands);
};
Loading

0 comments on commit 266eacf

Please sign in to comment.