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

allowPrerelease not working for GitHub provider #8893

Open
itsskofficial opened this issue Feb 23, 2025 · 0 comments
Open

allowPrerelease not working for GitHub provider #8893

itsskofficial opened this issue Feb 23, 2025 · 0 comments

Comments

@itsskofficial
Copy link

I have been trying this for long but I don't get how to release stable and beta versions for my users. As GitHub doesn't support channels I aim to treat Pre-Releases as beta releases and Latest Releases as stable releases for my users. I want to conditionally allow prerelease auto updates based on whether the user is in the beta program or not

I tried setting autoUpdater.allowPrelease = true and released v1.4.4 as Pre-Release on GitHub. Then I released v1.4.5 with the same config. I also tried setting channel to beta and releasing with v1.4.5-beta but to no avail. It seems auto update is not triggered at all for pre releases cause the same scenario works well for latest releases in my case

Here is my code

const checkForUpdates = async () => {
	const betaUserStatus = await getBetaUserStatus() // this is set conditonally

	if (betaUserStatus) {

		autoUpdater.allowPrerelease = true
	} 

	if(autoUpdater.allowPrerelease) {
		writeToLog("Checking for updates (beta)") // i can see this log in my log file
	}

	createAppWindow()

	autoUpdater.checkForUpdatesAndNotify()
}

Here is my Electron builder config

appId: "com.existence-sentient.sentient"
productName: "Sentient"
copyright: "Existence"
generateUpdatesFilesForAllChannels: true

win:
  target:
    - "nsis"
    - "dir"
  icon: "public/images/half-logo-dark.png"
  requestedExecutionLevel: "requireAdministrator"

nsis:
  allowToChangeInstallationDirectory: false
  runAfterFinish: false
  createDesktopShortcut: true
  createStartMenuShortcut: true
  include: "build/installer.nsh"
  artifactName: "ClientInstaller.${ext}"

linux:
  target:
    - "AppImage"
    - "deb"
  icon: "public/images/half-logo-dark.png"

mac:
  target:
    - "dmg"
    - "zip"
  icon: "public/images/half-logo-dark.png"

extraResources:
  - ".env"

publish:
  provider: "github"
  owner: "existence-master"
  repo: "Sentient-Internal"

I don't understand what to do. Ideally, this should work.

Any help is appreciated

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

No branches or pull requests

1 participant