Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
validate:
name: Validate
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Check release version metadata
run: npm run check:release-version

- name: Typecheck
run: npm run typecheck

- name: Lint
run: npm run lint

- name: Test
run: npm test

- name: Build
run: npm run build
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
windows-installer:
name: Windows Installer
runs-on: windows-latest
env:
CSC_IDENTITY_AUTO_DISCOVERY: "false"

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Check release tag
run: npm run check:release-version -- ${{ github.ref_name }}

- name: Typecheck
run: npm run typecheck

- name: Lint
run: npm run lint

- name: Test
run: npm test

- name: Build Windows installer
run: npm run package:windows

- name: Upload installer artifact
uses: actions/upload-artifact@v7
with:
name: gamevault-windows-${{ github.ref_name }}
path: |
apps/desktop/release/*.exe
apps/desktop/release/*.blockmap
if-no-files-found: error

- name: Publish GitHub release
uses: softprops/action-gh-release@v3
with:
name: GameVault ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: |
apps/desktop/release/*.exe
apps/desktop/release/*.blockmap
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ packages/*/tests/*.test.d.ts.map
apps/desktop/.vite
apps/extension/.cache
apps/desktop/dev-data
apps/desktop/release
61 changes: 53 additions & 8 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,70 @@
{
"name": "@gamevault/desktop",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"description": "Desktop companion app for tracking GameVault library updates.",
"author": "GameVault",
"productName": "GameVault",
"type": "module",
"main": "./dist/main/index.cjs",
"scripts": {
"build": "npm run build --workspace @gamevault/shared-types && npm run build --workspace @gamevault/source-core && npm run build --workspace @gamevault/steam-core && node ./scripts/build.mjs",
"dev": "npm run build && electron .",
"package:windows": "npm run build && set CSC_IDENTITY_AUTO_DISCOVERY=false&& electron-builder --win nsis --x64 --publish=never",
"test": "vitest run"
},
"dependencies": {
"7zip-bin-full": "^26.0.1",
"sql.js": "^1.14.1"
},
"devDependencies": {
"@fortawesome/fontawesome-svg-core": "^7.2.0",
"@fortawesome/free-solid-svg-icons": "^7.2.0",
"@fortawesome/react-fontawesome": "^3.3.1",
"@gamevault/shared-types": "0.1.0",
"@gamevault/source-core": "0.1.0",
"@gamevault/steam-core": "0.1.0",
"7zip-bin-full": "^26.0.1",
"electron": "^41.2.1",
"@gamevault/shared-types": "1.0.0",
"@gamevault/source-core": "1.0.0",
"@gamevault/steam-core": "1.0.0",
"electron": "41.2.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"sql.js": "^1.14.1"
"react-dom": "^19.1.0"
},
"build": {
"appId": "com.gamevault.desktop",
"productName": "GameVault",
"asar": true,
"asarUnpack": [
"dist/native-host/**/*",
"node_modules/7zip-bin-full/**/*"
],
"directories": {
"output": "release"
},
"files": [
"dist/**/*",
"package.json"
],
"win": {
"signAndEditExecutable": false,
"target": [
{
"target": "nsis",
"arch": [
"x64"
]
}
],
"icon": "src/assets/gamevault-icon.ico",
"artifactName": "GameVault-Setup-${version}.${ext}"
},
"nsis": {
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"createDesktopShortcut": true,
"createStartMenuShortcut": true,
"installerIcon": "src/assets/gamevault-icon.ico",
"uninstallerIcon": "src/assets/gamevault-icon.ico",
"shortcutName": "GameVault"
}
}
}
21 changes: 19 additions & 2 deletions apps/desktop/scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,25 @@ await copyFile(
const packageJson = JSON.parse(
await readFile(resolve(rootDir, 'package.json'), 'utf8'),
);
packageJson.main = './dist/main/index.cjs';
const runtimeDependencies = ['7zip-bin-full', 'sql.js'];
const distPackageJson = {
name: packageJson.name,
version: packageJson.version,
private: packageJson.private,
description: packageJson.description,
productName: packageJson.productName,
type: packageJson.type,
main: './main/index.cjs',
dependencies: Object.fromEntries(
runtimeDependencies
.map((dependency) => [
dependency,
packageJson.dependencies?.[dependency],
])
.filter((entry) => Boolean(entry[1])),
),
};
await writeFile(
join(distDir, 'package.json'),
JSON.stringify(packageJson, null, 2),
JSON.stringify(distPackageJson, null, 2),
);
8 changes: 6 additions & 2 deletions apps/desktop/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ let scheduler: GameVaultScheduler | null = null;
let quitting = false;
const backgroundLaunch = process.argv.includes('--background');
const DATABASE_FILE_NAME = 'gamevault.sqlite';
const GAMEVAULT_APP_USER_MODEL_ID = 'GameVault';
const GAMEVAULT_APP_USER_MODEL_ID = 'com.gamevault.desktop';
const LEGACY_DATABASE_FILE_NAME = 'vaulttrack.sqlite';

function getAsarUnpackedPath(filePath: string) {
return filePath.replace(/([/\\])app\.asar([/\\])/, '$1app.asar.unpacked$2');
}

function getAssetPath(fileName: string) {
return join(__dirname, '..', 'assets', fileName);
}
Expand Down Expand Up @@ -89,7 +93,7 @@ function getRendererUrl() {
}

function getNativeHostBundlePath() {
return join(__dirname, '..', 'native-host', 'index.cjs');
return getAsarUnpackedPath(join(__dirname, '..', 'native-host', 'index.cjs'));
}

async function getExtensionSetupInfo(): Promise<ExtensionSetupInfo> {
Expand Down
6 changes: 5 additions & 1 deletion apps/desktop/src/main/services/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import { path7z } from '7zip-bin-full';

const execFileAsync = promisify(execFile);

function getAsarUnpackedPath(filePath: string) {
return filePath.replace(/([/\\])app\.asar([/\\])/, '$1app.asar.unpacked$2');
}

function normalizeTitle(input: string): string {
return input
.toLowerCase()
Expand Down Expand Up @@ -293,7 +297,7 @@ async function extractZipArchive(
): Promise<void> {
await ensureDirectory(destinationPath);
await execFileAsync(
path7z,
getAsarUnpackedPath(path7z),
['x', zipPath, `-o${destinationPath}`, '-y', '-bso0', '-bsp0'],
{
maxBuffer: 64 * 1024 * 1024,
Expand Down
8 changes: 4 additions & 4 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gamevault/extension",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
Expand All @@ -12,9 +12,9 @@
"@fortawesome/fontawesome-svg-core": "^7.2.0",
"@fortawesome/free-solid-svg-icons": "^7.2.0",
"@fortawesome/react-fontawesome": "^3.3.1",
"@gamevault/shared-types": "0.1.0",
"@gamevault/source-core": "0.1.0",
"@gamevault/steam-core": "0.1.0",
"@gamevault/shared-types": "1.0.0",
"@gamevault/source-core": "1.0.0",
"@gamevault/steam-core": "1.0.0",
"react": "^19.1.0",
"react-dom": "^19.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "GameVault",
"version": "0.1.0",
"version": "1.0.0",
"description": "Add supported game pages to GameVault and monitor library status.",
"icons": {
"16": "icons/gamevault-16.png",
Expand Down
Loading