Skip to content

Commit 49c2bc3

Browse files
committed
Merge branch 'release/v3.7.2'
2 parents 49df406 + 499a830 commit 49c2bc3

File tree

6 files changed

+36
-14
lines changed

6 files changed

+36
-14
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ MAIN_VITE_AUTH_URL=
33
MAIN_VITE_WS_URL=
44
RENDERER_VITE_REAL_DEBRID_REFERRAL_ID=
55
RENDERER_VITE_TORBOX_REFERRAL_CODE=
6+
MAIN_VITE_LAUNCHER_SUBDOMAIN=

.github/workflows/build-renderer.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,38 @@ concurrency:
66

77
on:
88
push:
9-
branches: [main]
9+
branches:
10+
- main
11+
- release/**
1012

1113
jobs:
1214
build:
1315
runs-on: ubuntu-latest
1416

17+
permissions:
18+
contents: read
19+
20+
env:
21+
NODE_OPTIONS: --max-old-space-size=4096
22+
BRANCH_NAME: ${{ github.ref_name }}
23+
1524
steps:
1625
- name: Check out Git repository
1726
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
1829

19-
- name: Install Node.js
30+
- name: Set up Node.js
2031
uses: actions/setup-node@v4
2132
with:
2233
node-version: 22.21.0
34+
cache: "yarn"
35+
36+
- name: Enable Corepack (Yarn)
37+
run: corepack enable
2338

2439
- name: Install dependencies
25-
run: yarn --frozen-lockfile --ignore-scripts
40+
run: yarn install --frozen-lockfile --ignore-scripts
2641

2742
- name: Build Renderer
2843
run: yarn build
@@ -36,5 +51,5 @@ jobs:
3651
run: |
3752
npx --yes wrangler@3 pages deploy out/renderer \
3853
--project-name="hydra" \
39-
--commit-dirty=true \
40-
--branch="main"
54+
--branch "$BRANCH_NAME" \
55+
--commit-dirty

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ concurrency:
66

77
on:
88
push:
9-
branches: [main]
9+
branches:
10+
- release/**
1011

1112
jobs:
1213
build:
@@ -61,7 +62,7 @@ jobs:
6162
RENDERER_VITE_SENTRY_DSN: ${{ vars.SENTRY_DSN }}
6263
RENDERER_VITE_REAL_DEBRID_REFERRAL_ID: ${{ vars.RENDERER_VITE_REAL_DEBRID_REFERRAL_ID }}
6364
RENDERER_VITE_TORBOX_REFERRAL_CODE: ${{ vars.RENDERER_VITE_TORBOX_REFERRAL_CODE }}
64-
MAIN_VITE_RENDERER_URL: ${{ vars.MAIN_VITE_RENDERER_URL }}
65+
MAIN_VITE_LAUNCHER_SUBDOMAIN: ${{ vars.MAIN_VITE_LAUNCHER_SUBDOMAIN }}
6566

6667
- name: Build Windows
6768
if: matrix.os == 'windows-2022'
@@ -78,7 +79,7 @@ jobs:
7879
RENDERER_VITE_SENTRY_DSN: ${{ vars.SENTRY_DSN }}
7980
RENDERER_VITE_REAL_DEBRID_REFERRAL_ID: ${{ vars.RENDERER_VITE_REAL_DEBRID_REFERRAL_ID }}
8081
RENDERER_VITE_TORBOX_REFERRAL_CODE: ${{ vars.RENDERER_VITE_TORBOX_REFERRAL_CODE }}
81-
MAIN_VITE_RENDERER_URL: ${{ vars.MAIN_VITE_RENDERER_URL }}
82+
MAIN_VITE_LAUNCHER_SUBDOMAIN: ${{ vars.MAIN_VITE_LAUNCHER_SUBDOMAIN }}
8283

8384
- name: Create artifact
8485
uses: actions/upload-artifact@v4

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hydralauncher",
3-
"version": "3.7.1",
3+
"version": "3.7.2",
44
"description": "Hydra",
55
"main": "./out/main/index.js",
66
"author": "Los Broxas",

src/main/services/window-manager.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import type {
2525
} from "@types";
2626
import { AuthPage, generateAchievementCustomNotificationTest } from "@shared";
2727
import { isStaging } from "@main/constants";
28+
import { logger } from "./logger";
2829

2930
export class WindowManager {
3031
public static mainWindow: Electron.BrowserWindow | null = null;
@@ -54,21 +55,25 @@ export class WindowManager {
5455
show: false,
5556
};
5657

58+
private static formatVersionNumber(version: string) {
59+
return version.replaceAll(".", "-");
60+
}
61+
5762
private static async loadWindowURL(window: BrowserWindow, hash: string = "") {
5863
// HMR for renderer base on electron-vite cli.
5964
// Load the remote URL for development or the local html file for production.
6065
if (is.dev && process.env["ELECTRON_RENDERER_URL"]) {
6166
window.loadURL(`${process.env["ELECTRON_RENDERER_URL"]}#/${hash}`);
62-
} else if (import.meta.env.MAIN_VITE_RENDERER_URL) {
67+
} else if (import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN) {
6368
// Try to load from remote URL in production
6469
try {
6570
await window.loadURL(
66-
`${import.meta.env.MAIN_VITE_RENDERER_URL}#/${hash}`
71+
`https://release-v${this.formatVersionNumber(app.getVersion())}.${import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN}#/${hash}`
6772
);
6873
} catch (error) {
6974
// Fall back to local file if remote URL fails
70-
console.error(
71-
"Failed to load from MAIN_VITE_RENDERER_URL, falling back to local file:",
75+
logger.error(
76+
"Failed to load from MAIN_VITE_LAUNCHER_SUBDOMAIN, falling back to local file:",
7277
error
7378
);
7479
window.loadFile(path.join(__dirname, "../renderer/index.html"), {

src/main/vite-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface ImportMetaEnv {
77
readonly MAIN_VITE_CHECKOUT_URL: string;
88
readonly MAIN_VITE_EXTERNAL_RESOURCES_URL: string;
99
readonly MAIN_VITE_WS_URL: string;
10-
readonly MAIN_VITE_RENDERER_URL: string;
10+
readonly MAIN_VITE_LAUNCHER_SUBDOMAIN: string;
1111
readonly ELECTRON_RENDERER_URL: string;
1212
}
1313

0 commit comments

Comments
 (0)