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

fix windows autoupdate #744

Merged
merged 9 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/win-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,28 @@ jobs:
env:
WINDOWS_SIGNING_PASSPHRASE: ${{ secrets.WINDOWS_SIGNING_PASSPHRASE }}
WINDOWS_SIGNING_PFX_BASE64: ${{ secrets.WINDOWS_SIGNING_PFX_BASE64 }}
- name: upload release assets
- name: upload release executable
uses: svenstaro/upload-release-action@1.1.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: dist\installers\Brim-Setup.exe
asset_name: Brim-Setup.exe
overwrite: true
- name: upload RELEASES file
uses: svenstaro/upload-release-action@1.1.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: dist\installers\RELEASES
asset_name: RELEASES
overwrite: true
- name: upload nupkg assets
uses: svenstaro/upload-release-action@1.1.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: dist\installers\*.nupkg
overwrite: true
file_glob: true

18 changes: 9 additions & 9 deletions src/js/electron/autoUpdater.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/* @flow */
import path from "path"
import {app, autoUpdater, dialog} from "electron"
import log from "electron-log"

export function setupAutoUpdater() {
const feedURL = path.join(
"https://update.electronjs.org/brimsec/brim",
process.platform,
app.getVersion()
)
const feedURL = `https://update.electronjs.org/brimsec/brim/${
process.platform
}/${app.getVersion()}`
autoUpdater.setFeedURL(feedURL)

autoUpdater.on("update-downloaded", (event, releaseNotes, releaseName) => {
Expand All @@ -27,11 +25,13 @@ export function setupAutoUpdater() {
})

autoUpdater.on("error", (err) => {
console.error("There was a problem updating the application: " + err)
log.error("There was a problem updating the application: " + err)
})

// check for updates immediately on startup
autoUpdater.checkForUpdates()
// check for updates 30s after startup
setTimeout(() => {
autoUpdater.checkForUpdates()
}, 30 * 1000)

// then check for updates once a day
setInterval(() => {
Expand Down