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
feat: upgrade Keygen integration to v1.1 #6941
feat: upgrade Keygen integration to v1.1 #6941
Conversation
🦋 Changeset detectedLatest commit: d1cf92c The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for car-park-attendant-cleat-11576 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
808b4c7
to
f3079f9
Compare
25ed88a
to
733e4c5
Compare
733e4c5
to
d1cf92c
Compare
attributes: { | ||
version: this.version, | ||
channel: this.info.channel || "stable", | ||
status: "PUBLISHED", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to start with a DRAFT
status for the release, and publish only after all artifacts are uploaded, but I couldn't find a hook to accomplish that (i.e. letting the publisher perform an additional request once all artifacts are uploaded). LMK if one exists and I just happened to miss it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I don't see any in the code for that functionality, but it totally seems like a valid reason to have one added :)
Seems like an onArtifactUploaded
could be added here? Simply need to add a task (i.e. Promise) to the taskManager
after the scheduleUpload
electron-builder/packages/app-builder-lib/src/publish/PublishManager.ts
Lines 123 to 133 in 03cc9b9
packager.artifactCreated(event => { | |
const publishConfiguration = event.publishConfig | |
if (publishConfiguration == null) { | |
this.taskManager.addTask(this.artifactCreatedWithoutExplicitPublishConfig(event)) | |
} else if (this.isPublish) { | |
if (debug.enabled) { | |
debug(`artifactCreated (isPublish: ${this.isPublish}): ${safeStringifyJson(event, new Set(["packager"]))},\n publishConfig: ${safeStringifyJson(publishConfiguration)}`) | |
} | |
this.scheduleUpload(publishConfiguration, event, this.getAppInfo(event.packager)) | |
} | |
}) |
From my quick look, an onAllArtifactsUploaded
hook could probably be added here:
electron-builder/packages/app-builder-lib/src/publish/PublishManager.ts
Lines 230 to 241 in 03cc9b9
async awaitTasks(): Promise<void> { | |
await this.taskManager.awaitTasks() | |
const updateInfoFileTasks = this.updateFileWriteTask | |
if (this.cancellationToken.cancelled || updateInfoFileTasks.length === 0) { | |
return | |
} | |
await writeUpdateInfoFiles(updateInfoFileTasks, this.packager) | |
await this.taskManager.awaitTasks() | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only adding onAllArtifactsUploaded
, which is probably all we need for now, the best place might just be adding it here:
promise = publishManager.awaitTasks() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about doing that in a separate follow-up PR, and then updating the Keygen publisher while I'm there. Is that cool? As-is, I think the current publisher works even if it does skip the draft stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me 😄
I think this is Ready for Review then? Merge button is disabled atm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Published 23.2.0 + electron-updater@5.0.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Marked this as ready for review. 👍
Follow up to #6909, which covers the API changes more in-depth. This should have no breaking changes for app's that are upgrading from v1.0 to v1.1 of the API, since it's only related to publishing (the auto-upgrade functionality still works as it did before from a consumer standpoint), so I think it's safe to include in a minor electron-builder update.
I don't think this should be merged until #6920 is out, to give an option to pin to v1.0 for whatever reason (via #6909).