electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with β€œauto update” support out of the box
https://www.electron.build
MIT License
13.47k stars 1.72k forks source link

feat: Add Support for a separate Github release token to the auto-update token #8173

Closed AndrewEQ closed 2 months ago

AndrewEQ commented 3 months ago

Reference: https://github.com/electron-userland/electron-builder/issues/5688 - Discussion about keeping two separate tokens; one for publishing to Github releases and the other used by the app to make requests for auto-update updates.

Now you can set a release token that has write permissions to publish your release.

The release token will be used instead of a GH_TOKEN || GITHUB_TOKEN ONLY during publishing.

The Github token defined via the Github options or environment variable will still be used as normal.

mac: export GITHUB_RELEASE_TOKEN=<my token>

I used the Contents permission for a New fine-grained personal access token with "Read and write". "Read-only" for the usual app-update token.

So even if the app-update token is inside your app-update.yml its only read-only, yay! (Mac: you can find the app-update.yml by right-click > Show Package Contents > Contents > Resources)

changeset-bot[bot] commented 3 months ago

πŸ¦‹ Changeset detected

Latest commit: 08d986ea98e2af6904f502c863ede1f51e14070e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages | Name | Type | | --------------------------------- | ----- | | electron-publish | Major | | app-builder-lib | Major | | dmg-builder | Major | | electron-builder-squirrel-windows | Major | | electron-builder | Major | | electron-forge-maker-appimage | Major | | electron-forge-maker-nsis-web | Major | | electron-forge-maker-nsis | Major | | electron-forge-maker-snap | Major |

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

netlify[bot] commented 3 months ago

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
Latest commit 08d986ea98e2af6904f502c863ede1f51e14070e
Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/661ff4b5b393880008b5e991
Deploy Preview https://deploy-preview-8173--car-park-attendant-cleat-11576.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

mmaietta commented 2 months ago

Love this idea, thank you for opening a PR!

Do we need to update the docs anywhere for this change? Looks like this may need to be updated to include your new logic/description https://www.electron.build/configuration/publish

AndrewEQ commented 2 months ago

Love this idea, thank you for opening a PR!

Do we need to update the docs anywhere for this change? Looks like this may need to be updated to include your new logic/description https://www.electron.build/configuration/publish

Cool, added a note to the publish docs πŸ‘