Fixing Git issue, updated notarize flow
This commit is contained in:
parent
78eb4050ae
commit
259f12b07a
1 changed files with 13 additions and 30 deletions
43
notarize.js
43
notarize.js
|
|
@ -2,9 +2,8 @@ const exec = require('child_process').exec;
|
|||
const sign = require("electron-osx-sign").signAsync;
|
||||
const notarize = require("electron-notarize").notarize;
|
||||
|
||||
const name = "Crimata";
|
||||
const dir = `${name}.app/Contents/Resources/app`;
|
||||
const registry = "https://gitlab.com/api/v4/projects/25637892/packages/generic/crimata/0.0.1/Crimata.zip";
|
||||
const app = "Crimata.app";
|
||||
const dir = `${app}/Contents/Resources/app`;
|
||||
|
||||
const runShellCommand = (cmd) => (new Promise((resolve, reject) => {
|
||||
exec(cmd, (error, stdout, stderr) => {
|
||||
|
|
@ -12,11 +11,8 @@ const runShellCommand = (cmd) => (new Promise((resolve, reject) => {
|
|||
});
|
||||
}));
|
||||
|
||||
// /projects/:id/packages/generic/:package_name/:package_version/:file_name?status=:status
|
||||
|
||||
|
||||
const signConfig = {
|
||||
"app": name + ".app",
|
||||
"app": app,
|
||||
"hardened-runtime": true,
|
||||
"gatekeeper-assess": false,
|
||||
"signature-flags": "library",
|
||||
|
|
@ -25,7 +21,7 @@ const signConfig = {
|
|||
};
|
||||
|
||||
const notarizeConfig = {
|
||||
appPath: name + ".app",
|
||||
appPath: app,
|
||||
appleId: "gundersena@crimata.com",
|
||||
appBundleId: "com.crimata.CrimataMessenger",
|
||||
appleIdPassword: process.env["AC_PASSWORD"]
|
||||
|
|
@ -35,24 +31,18 @@ const notarizeConfig = {
|
|||
|
||||
try
|
||||
{
|
||||
// console.log("Building...");
|
||||
// await runShellCommand(`rm -rf ${dir} && mkdir ${dir} && cp -r {package.json,src,node_modules} ${dir}
|
||||
// `);
|
||||
console.log("Building...");
|
||||
await runShellCommand(`rm -rf ${dir} && mkdir ${dir} && cp -r {package.json,src,node_modules} ${dir}
|
||||
`);
|
||||
|
||||
// console.log("Cleaning...");
|
||||
// await runShellCommand(`xattr -cr ${name}.app`);
|
||||
console.log("Cleaning...");
|
||||
await runShellCommand(`xattr -cr ${app}`);
|
||||
|
||||
// console.log("Signing...");
|
||||
// await sign(signConfig);
|
||||
console.log("Signing...");
|
||||
await sign(signConfig);
|
||||
|
||||
// console.log("Notarizing...");
|
||||
// await notarize(notarizeConfig);
|
||||
|
||||
// console.log("Compressing...");
|
||||
// await runShellCommand(`zip -vr ${name}.zip ${name}.app`);
|
||||
|
||||
console.log("Uploading to Gitlab...");
|
||||
await runShellCommand(`curl --header "PRIVATE-TOKEN: ${process.env["API_TOKEN"]}" --upload-file ${name}.zip "${registry}"`);
|
||||
console.log("Notarizing...");
|
||||
await notarize(notarizeConfig);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
|
|
@ -60,10 +50,3 @@ const notarizeConfig = {
|
|||
}
|
||||
|
||||
})();
|
||||
|
||||
|
||||
/**
|
||||
* Copy file from local to remote:
|
||||
*
|
||||
* scp -r Electron.app gundersena@crimata-server:~/Desktop/crimata/website/assets
|
||||
*/
|
||||
Loading…
Reference in a new issue