mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-02 16:23:48 +03:00
feat: adding electron updater
This commit is contained in:
parent
125264ff42
commit
05cc2a1206
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
@ -66,3 +66,21 @@ jobs:
|
|||||||
dist/*.tar.gz
|
dist/*.tar.gz
|
||||||
dist/*.yml
|
dist/*.yml
|
||||||
dist/*.blockmap
|
dist/*.blockmap
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
files: |
|
||||||
|
dist/*.exe
|
||||||
|
dist/*.zip
|
||||||
|
dist/*.dmg
|
||||||
|
dist/*.AppImage
|
||||||
|
dist/*.snap
|
||||||
|
dist/*.deb
|
||||||
|
dist/*.rpm
|
||||||
|
dist/*.tar.gz
|
||||||
|
dist/*.yml
|
||||||
|
dist/*.blockmap
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -46,5 +46,7 @@ appImage:
|
|||||||
npmRebuild: false
|
npmRebuild: false
|
||||||
publish:
|
publish:
|
||||||
provider: github
|
provider: github
|
||||||
|
owner: hydralauncher
|
||||||
|
repo: hydra
|
||||||
electronDownload:
|
electronDownload:
|
||||||
mirror: https://npmmirror.com/mirrors/electron/
|
mirror: https://npmmirror.com/mirrors/electron/
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
"color.js": "^1.2.0",
|
"color.js": "^1.2.0",
|
||||||
"date-fns": "^3.6.0",
|
"date-fns": "^3.6.0",
|
||||||
"easydl": "^1.1.1",
|
"easydl": "^1.1.1",
|
||||||
|
"electron-updater": "^6.1.8",
|
||||||
"fetch-cookie": "^3.0.1",
|
"fetch-cookie": "^3.0.1",
|
||||||
"flexsearch": "^0.7.43",
|
"flexsearch": "^0.7.43",
|
||||||
"i18next": "^23.11.2",
|
"i18next": "^23.11.2",
|
||||||
|
@ -15,9 +15,8 @@ export const createDataSource = (options: Partial<SqliteConnectionOptions>) =>
|
|||||||
type: "better-sqlite3",
|
type: "better-sqlite3",
|
||||||
database: databasePath,
|
database: databasePath,
|
||||||
entities: [Game, Repack, UserPreferences, GameShopCache, SteamGame],
|
entities: [Game, Repack, UserPreferences, GameShopCache, SteamGame],
|
||||||
|
synchronize: true,
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const dataSource = createDataSource({
|
export const dataSource = createDataSource({});
|
||||||
synchronize: true,
|
|
||||||
});
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { app, BrowserWindow, net, protocol } from "electron";
|
import { app, BrowserWindow, net, protocol } from "electron";
|
||||||
|
import updater from "electron-updater";
|
||||||
import i18n from "i18next";
|
import i18n from "i18next";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { electronApp, optimizer } from "@electron-toolkit/utils";
|
import { electronApp, optimizer } from "@electron-toolkit/utils";
|
||||||
@ -7,6 +8,14 @@ import { dataSource } from "@main/data-source";
|
|||||||
import * as resources from "@locales";
|
import * as resources from "@locales";
|
||||||
import { userPreferencesRepository } from "@main/repository";
|
import { userPreferencesRepository } from "@main/repository";
|
||||||
|
|
||||||
|
const { autoUpdater } = updater;
|
||||||
|
|
||||||
|
autoUpdater.setFeedURL({
|
||||||
|
provider: "github",
|
||||||
|
owner: "hydralauncher",
|
||||||
|
repo: "hydra",
|
||||||
|
});
|
||||||
|
|
||||||
const gotTheLock = app.requestSingleInstanceLock();
|
const gotTheLock = app.requestSingleInstanceLock();
|
||||||
if (!gotTheLock) app.quit();
|
if (!gotTheLock) app.quit();
|
||||||
|
|
||||||
@ -52,6 +61,10 @@ app.whenReady().then(() => {
|
|||||||
|
|
||||||
WindowManager.createMainWindow();
|
WindowManager.createMainWindow();
|
||||||
WindowManager.createSystemTray(userPreferences?.language || "en");
|
WindowManager.createSystemTray(userPreferences?.language || "en");
|
||||||
|
|
||||||
|
WindowManager.mainWindow?.on("ready-to-show", () => {
|
||||||
|
autoUpdater.checkForUpdatesAndNotify();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user