Skip to content
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(updater): Add Channel Support for Github with PreRelease #6505

Merged
merged 13 commits into from Jan 27, 2022
Merged

feat(updater): Add Channel Support for Github with PreRelease #6505

merged 13 commits into from Jan 27, 2022

Conversation

KenCorma
Copy link
Contributor

Allows for apps to run updates using provided channel track.
This only works if options.allowPreRelease is true.

If Channel is set in the updater, then latest will return the latest release that satisfies the logic in the builder docs

If Channel is NOT set but prerelease is set, then latest will return the latest release.

technically this also supports custom channels, but if you run one of those you will never be able to return to the Latest track.

I have marked this as a PR Draft as I would like to get discussion to make sure my logic is correct as well as this being my first contribution to this repo.

Tag:
#1722
#4988

@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2021

🦋 Changeset detected

Latest commit: be34e52

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

This PR includes changesets to release 1 package
Name Type
electron-updater Minor

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

@KenCorma KenCorma marked this pull request as ready for review January 6, 2022 17:18
@netlify
Copy link

netlify bot commented Jan 17, 2022

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

🔨 Explore the source changes: be34e52

🔍 Inspect the deploy log: https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/61f2fee104fa520007454aa9

😎 Browse the preview: https://deploy-preview-6505--car-park-attendant-cleat-11576.netlify.app

@mmaietta
Copy link
Collaborator

Whoops, seems there was an error in some code I suggested:

packages/electron-updater/src/providers/GitHubProvider.ts:76:63 - error TS2345: Argument of type 'string | number | null' is not assignable to parameter of type 'string'.
  Type 'null' is not assignable to type 'string'.

76           const isCustomChannel = !['alpha', 'beta'].includes(hrefChannel)

Since we don't care about number/null when comparing against alpha/beta, let's just wrap hrefChannel to be String(hrefChannel)

@KenCorma
Copy link
Contributor Author

@mmaietta No problem, added that guard.

@mmaietta mmaietta self-requested a review January 25, 2022 17:28
@mmaietta
Copy link
Collaborator

Looks like eslint is throwing an error:

Error: 111:9 error Type string trivially inferred from a string literal, remove type annotation @typescript-eslint/no-inferrable-types

The rest of the warnings should be easily resolved through pnpm prettier && pnpx lint --fix and then I think we're good to merge 🙂

@KenCorma
Copy link
Contributor Author

My bad I didn't realize I had prettier off on this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants