Skip to content

Commit

Permalink
fix windows autoupdate (#744)
Browse files Browse the repository at this point in the history
* debug autoupdating, delay 30s

Signed-off-by: Mason Fish <mason@looky.cloud>

* use correct logger

Signed-off-by: Mason Fish <mason@looky.cloud>

* change path join

Signed-off-by: Mason Fish <mason@looky.cloud>

* use URL.resolve

Signed-off-by: Mason Fish <mason@looky.cloud>

* include RELEASES and .nupkg files with release assets

Signed-off-by: Mason Fish <mason@looky.cloud>

* fix url

Signed-off-by: Mason Fish <mason@looky.cloud>

* just use template string

Signed-off-by: Mason Fish <mason@looky.cloud>

* remove log

Signed-off-by: Mason Fish <mason@looky.cloud>

* fix dev flag

Signed-off-by: Mason Fish <mason@looky.cloud>

Co-authored-by: Mason Fish <mason@looky.cloud>
  • Loading branch information
mason-fish and Mason Fish authored May 5, 2020
1 parent a932adc commit d586fc0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
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

0 comments on commit d586fc0

Please sign in to comment.