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 sign = require("electron-osx-sign").signAsync;
|
||||||
const notarize = require("electron-notarize").notarize;
|
const notarize = require("electron-notarize").notarize;
|
||||||
|
|
||||||
const name = "Crimata";
|
const app = "Crimata.app";
|
||||||
const dir = `${name}.app/Contents/Resources/app`;
|
const dir = `${app}/Contents/Resources/app`;
|
||||||
const registry = "https://gitlab.com/api/v4/projects/25637892/packages/generic/crimata/0.0.1/Crimata.zip";
|
|
||||||
|
|
||||||
const runShellCommand = (cmd) => (new Promise((resolve, reject) => {
|
const runShellCommand = (cmd) => (new Promise((resolve, reject) => {
|
||||||
exec(cmd, (error, stdout, stderr) => {
|
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 = {
|
const signConfig = {
|
||||||
"app": name + ".app",
|
"app": app,
|
||||||
"hardened-runtime": true,
|
"hardened-runtime": true,
|
||||||
"gatekeeper-assess": false,
|
"gatekeeper-assess": false,
|
||||||
"signature-flags": "library",
|
"signature-flags": "library",
|
||||||
|
|
@ -25,7 +21,7 @@ const signConfig = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const notarizeConfig = {
|
const notarizeConfig = {
|
||||||
appPath: name + ".app",
|
appPath: app,
|
||||||
appleId: "gundersena@crimata.com",
|
appleId: "gundersena@crimata.com",
|
||||||
appBundleId: "com.crimata.CrimataMessenger",
|
appBundleId: "com.crimata.CrimataMessenger",
|
||||||
appleIdPassword: process.env["AC_PASSWORD"]
|
appleIdPassword: process.env["AC_PASSWORD"]
|
||||||
|
|
@ -35,24 +31,18 @@ const notarizeConfig = {
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// console.log("Building...");
|
console.log("Building...");
|
||||||
// await runShellCommand(`rm -rf ${dir} && mkdir ${dir} && cp -r {package.json,src,node_modules} ${dir}
|
await runShellCommand(`rm -rf ${dir} && mkdir ${dir} && cp -r {package.json,src,node_modules} ${dir}
|
||||||
// `);
|
`);
|
||||||
|
|
||||||
// console.log("Cleaning...");
|
console.log("Cleaning...");
|
||||||
// await runShellCommand(`xattr -cr ${name}.app`);
|
await runShellCommand(`xattr -cr ${app}`);
|
||||||
|
|
||||||
// console.log("Signing...");
|
console.log("Signing...");
|
||||||
// await sign(signConfig);
|
await sign(signConfig);
|
||||||
|
|
||||||
// console.log("Notarizing...");
|
console.log("Notarizing...");
|
||||||
// await notarize(notarizeConfig);
|
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}"`);
|
|
||||||
}
|
}
|
||||||
catch (e)
|
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