-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
afterAllArtifactBuild
Hook runs after file uploads / prevents them?
#7145
Comments
probably linked to #4446, however, as I'm not using the |
I digged a little bit into the code and it seems like the uploading is done automatically here electron-builder/packages/app-builder-lib/src/publish/PublishManager.ts Lines 123 to 134 in d71a579
However, that does not explain why the I think the best idea would be to add another hook like in #6766 (maybe called Edit: I'm happy to create a PR if someone points me in the right direction where that hook would have to go. |
After some more debugging, I found why the Because of the problems described above, I (hopefully temporarily) switched to a manual S3 notarization and upload script. That means I got rid of the |
latest.yml files are only created when there's a publish setting and under a few circumstances, such as |
It's strange, though, because on Windows and Linux (using matrix builds in GitHub Actions) everything worked fine. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Hi! I think I found a work around, so posting here for posterity 😄 require("dotenv").config();
const { spawn } = require("node:child_process");
const os = require("os");
exports.default = async function notarizing(context) {
if (os.platform() !== "darwin") {
console.log("Not notarizing app because not running on MacOS.");
return;
}
const filename = context.file.endsWith(".dmg") ? context.file : false;
if (!filename) {
console.log(`Skipping ${context.file}`);
return;
}
console.log("Notarizing app...");
console.log(`Found artifact: ${filename}`);
let auth = '--keychain-profile "AC_PASSWORD"';
if (process.env.APPLE_ID && process.env.APPLE_ID_PASS && process.env.TEAM_ID) {
auth = `--apple-id ${process.env.APPLE_ID} --password "${process.env.APPLE_ID_PASS}" --team-id ${process.env.TEAM_ID}`;
}
const content = await exec(`xcrun notarytool submit ${filename} ${auth} --wait`);
const uuid = content.match(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g)[0];
await exec(`xcrun notarytool log ${uuid} ${auth}`);
await exec(`xcrun stapler staple ${filename}`);
console.log("App notarized successfully.");
};
function exec(cmd) {
return new Promise((resolve, reject) => {
console.log(cmd);
const proc = spawn(cmd, [], { shell: true });
const chunks = [];
proc.stdout.on("data", (data) => {
console.log(data.toString());
chunks.push(data);
});
proc.stderr.on("data", (data) => {
console.error(data.toString());
chunks.push(data);
});
proc.on("close", (code) => {
console.log(`Process exited with code ${code}.`);
resolve(Buffer.concat(chunks).toString("utf8"));
});
});
} Its the same script @hrueger posted here but it skips all files that are not the required for notarization. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. |
I'm building a MacOS Universal app for the
pkg
target. Aselectron-notarize
can not currently notarize.pkg
files, I'm doing that myself in theafterAllArtifactBuild
hook.The notarization itself is working fine, however, the upload process starts before my script even runs. As the notarization script staples a ticket to the
.pkg
file, I want to upload the modified file.The second problem is, that it just does not upload the
latest-mac.yml
,beta-mac.yml
andalpha-mac.yml
files at all.Any idea?
The text was updated successfully, but these errors were encountered: