option to skip code signing on macos

This commit is contained in:
antelle 2020-06-04 20:13:15 +02:00
parent ff20d2a554
commit db38e015f8
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
5 changed files with 19 additions and 17 deletions

View File

@ -131,7 +131,7 @@ jobs:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- name: Grunt
run: grunt desktop-darwin
run: grunt desktop-darwin ${{ github.repository != 'keeweb/keeweb' && '--skip-sign' || '' }}
- name: Upload dmg artifact
uses: actions/upload-artifact@v1
with:

View File

@ -50,6 +50,7 @@ module.exports = function (grunt) {
};
grunt.initConfig({
noop: { noop: {} },
gitinfo: {
branch: {
current: {

View File

@ -0,0 +1,3 @@
module.exports = function (grunt) {
grunt.registerMultiTask('noop', 'This is a no-op task', () => {});
};

View File

@ -13,11 +13,7 @@ module.exports = function (grunt) {
const opt = this.options();
for (const [file, name] of Object.entries(opt.files)) {
if (!opt.windows && grunt.option('skip-sign')) {
grunt.log.writeln(`Skipped code-signing: ${file}`);
} else {
await signFile(file, name, opt);
}
await signFile(file, name, opt);
}
done();

View File

@ -1,4 +1,6 @@
module.exports = function (grunt) {
const sign = !grunt.option('skip-sign');
grunt.registerTask('build-web-app', [
'gitinfo',
'clean',
@ -45,17 +47,17 @@ module.exports = function (grunt) {
'copy:desktop-darwin-helper',
'copy:desktop-darwin-installer-helper',
'copy:native-modules-darwin',
'osx-sign:desktop',
'notarize:desktop'
sign ? 'osx-sign:desktop' : 'noop',
sign ? 'notarize:desktop' : 'noop'
]);
grunt.registerTask('build-desktop-executables-win32', [
'electron:win32-x64',
'electron:win32-ia32',
'electron:win32-arm64',
'sign-exe:win32-build-x64',
'sign-exe:win32-build-ia32',
'sign-exe:win32-build-arm64',
sign ? 'sign-exe:win32-build-x64' : 'noop',
sign ? 'sign-exe:win32-build-ia32' : 'noop',
sign ? 'sign-exe:win32-build-arm64' : 'noop',
'copy:desktop-windows-helper-x64',
'copy:desktop-windows-helper-ia32',
'copy:desktop-windows-helper-arm64',
@ -89,15 +91,15 @@ module.exports = function (grunt) {
'nsis:win32-un-x64',
'nsis:win32-un-ia32',
'nsis:win32-un-arm64',
'sign-exe:win32-uninst-x64',
'sign-exe:win32-uninst-ia32',
'sign-exe:win32-uninst-arm64',
sign ? 'sign-exe:win32-uninst-x64' : 'noop',
sign ? 'sign-exe:win32-uninst-ia32' : 'noop',
sign ? 'sign-exe:win32-uninst-arm64' : 'noop',
'nsis:win32-x64',
'nsis:win32-ia32',
'nsis:win32-arm64',
'sign-exe:win32-installer-x64',
'sign-exe:win32-installer-ia32',
'sign-exe:win32-installer-arm64',
sign ? 'sign-exe:win32-installer-x64' : 'noop',
sign ? 'sign-exe:win32-installer-ia32' : 'noop',
sign ? 'sign-exe:win32-installer-arm64' : 'noop',
'copy:desktop-win32-dist-x64',
'copy:desktop-win32-dist-ia32',
'copy:desktop-win32-dist-arm64'