From d586fc023d0a4bf6d061095eb52336ba3d61eb0f Mon Sep 17 00:00:00 2001 From: Mason Fish Date: Tue, 5 May 2020 12:16:44 -0700 Subject: [PATCH] fix windows autoupdate (#744) * debug autoupdating, delay 30s Signed-off-by: Mason Fish * use correct logger Signed-off-by: Mason Fish * change path join Signed-off-by: Mason Fish * use URL.resolve Signed-off-by: Mason Fish * include RELEASES and .nupkg files with release assets Signed-off-by: Mason Fish * fix url Signed-off-by: Mason Fish * just use template string Signed-off-by: Mason Fish * remove log Signed-off-by: Mason Fish * fix dev flag Signed-off-by: Mason Fish Co-authored-by: Mason Fish --- .github/workflows/win-release.yml | 19 ++++++++++++++++++- src/js/electron/autoUpdater.js | 18 +++++++++--------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/win-release.yml b/.github/workflows/win-release.yml index 7b180aee87..31b72e8f3d 100644 --- a/.github/workflows/win-release.yml +++ b/.github/workflows/win-release.yml @@ -54,7 +54,7 @@ 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 }} @@ -62,3 +62,20 @@ jobs: 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 + diff --git a/src/js/electron/autoUpdater.js b/src/js/electron/autoUpdater.js index 92bd6d133f..8cabc5c85c 100644 --- a/src/js/electron/autoUpdater.js +++ b/src/js/electron/autoUpdater.js @@ -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) => { @@ -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(() => {