mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-10 21:36:17 +00:00
ci: adding ci vars
This commit is contained in:
@@ -3,3 +3,4 @@ MAIN_VITE_AUTH_URL=
|
||||
MAIN_VITE_WS_URL=
|
||||
RENDERER_VITE_REAL_DEBRID_REFERRAL_ID=
|
||||
RENDERER_VITE_TORBOX_REFERRAL_CODE=
|
||||
MAIN_VITE_LAUNCHER_SUBDOMAIN=
|
||||
|
||||
4
.github/workflows/build-renderer.yml
vendored
4
.github/workflows/build-renderer.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.21.0
|
||||
cache: 'yarn'
|
||||
cache: "yarn"
|
||||
|
||||
- name: Enable Corepack (Yarn)
|
||||
run: corepack enable
|
||||
@@ -52,4 +52,4 @@ jobs:
|
||||
npx --yes wrangler@3 pages deploy out/renderer \
|
||||
--project-name="hydra" \
|
||||
--branch "$BRANCH_NAME" \
|
||||
--commit-dirty
|
||||
--commit-dirty
|
||||
|
||||
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -6,7 +6,9 @@ concurrency:
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches:
|
||||
- main
|
||||
- release/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -61,7 +63,7 @@ jobs:
|
||||
RENDERER_VITE_SENTRY_DSN: ${{ vars.SENTRY_DSN }}
|
||||
RENDERER_VITE_REAL_DEBRID_REFERRAL_ID: ${{ vars.RENDERER_VITE_REAL_DEBRID_REFERRAL_ID }}
|
||||
RENDERER_VITE_TORBOX_REFERRAL_CODE: ${{ vars.RENDERER_VITE_TORBOX_REFERRAL_CODE }}
|
||||
MAIN_VITE_RENDERER_URL: ${{ vars.MAIN_VITE_RENDERER_URL }}
|
||||
MAIN_VITE_LAUNCHER_SUBDOMAIN: ${{ vars.MAIN_VITE_LAUNCHER_SUBDOMAIN }}
|
||||
|
||||
- name: Build Windows
|
||||
if: matrix.os == 'windows-2022'
|
||||
@@ -78,7 +80,7 @@ jobs:
|
||||
RENDERER_VITE_SENTRY_DSN: ${{ vars.SENTRY_DSN }}
|
||||
RENDERER_VITE_REAL_DEBRID_REFERRAL_ID: ${{ vars.RENDERER_VITE_REAL_DEBRID_REFERRAL_ID }}
|
||||
RENDERER_VITE_TORBOX_REFERRAL_CODE: ${{ vars.RENDERER_VITE_TORBOX_REFERRAL_CODE }}
|
||||
MAIN_VITE_RENDERER_URL: ${{ vars.MAIN_VITE_RENDERER_URL }}
|
||||
MAIN_VITE_LAUNCHER_SUBDOMAIN: ${{ vars.MAIN_VITE_LAUNCHER_SUBDOMAIN }}
|
||||
|
||||
- name: Create artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
@@ -24,7 +24,8 @@ import type {
|
||||
UserPreferences,
|
||||
} from "@types";
|
||||
import { AuthPage, generateAchievementCustomNotificationTest } from "@shared";
|
||||
import { isStaging } from "@main/constants";
|
||||
import { appVersion, isStaging } from "@main/constants";
|
||||
import { logger } from "./logger";
|
||||
|
||||
export class WindowManager {
|
||||
public static mainWindow: Electron.BrowserWindow | null = null;
|
||||
@@ -54,6 +55,10 @@ export class WindowManager {
|
||||
show: false,
|
||||
};
|
||||
|
||||
private static formatVersionNumber(version: string) {
|
||||
return version.replaceAll(".", "-");
|
||||
}
|
||||
|
||||
private static async loadWindowURL(window: BrowserWindow, hash: string = "") {
|
||||
// HMR for renderer base on electron-vite cli.
|
||||
// Load the remote URL for development or the local html file for production.
|
||||
@@ -63,12 +68,12 @@ export class WindowManager {
|
||||
// Try to load from remote URL in production
|
||||
try {
|
||||
await window.loadURL(
|
||||
`${import.meta.env.MAIN_VITE_RENDERER_URL}#/${hash}`
|
||||
`https://release-${this.formatVersionNumber(appVersion)}.${import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN}#/${hash}`
|
||||
);
|
||||
} catch (error) {
|
||||
// Fall back to local file if remote URL fails
|
||||
console.error(
|
||||
"Failed to load from MAIN_VITE_RENDERER_URL, falling back to local file:",
|
||||
logger.error(
|
||||
"Failed to load from MAIN_VITE_LAUNCHER_SUBDOMAIN, falling back to local file:",
|
||||
error
|
||||
);
|
||||
window.loadFile(path.join(__dirname, "../renderer/index.html"), {
|
||||
|
||||
Reference in New Issue
Block a user