Skip to content

Commit

Permalink
Merge pull request #1031 from hydralauncher/feature/game-achievements
Browse files Browse the repository at this point in the history
game achievements
  • Loading branch information
zamitto authored Oct 21, 2024
2 parents 1176ddb + 1c63fc1 commit 9c59558
Show file tree
Hide file tree
Showing 187 changed files with 9,781 additions and 2,307 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ jobs:
sudo apt-get install -y libarchive-tools
yarn build:linux
env:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }}
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_STAGING_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_STAGING_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_STAGING_CHECKOUT_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -50,8 +51,9 @@ jobs:
if: matrix.os == 'windows-latest'
run: yarn build:win
env:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }}
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_STAGING_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_STAGING_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_STAGING_CHECKOUT_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -61,7 +63,6 @@ jobs:
with:
name: Build-${{ matrix.os }}
path: |
dist/win-unpacked/**
dist/*-portable.exe
dist/*.zip
dist/*.dmg
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
env:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_CHECKOUT_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -54,10 +55,27 @@ jobs:
env:
MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }}
MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }}
MAIN_VITE_CHECKOUT_URL: ${{ vars.MAIN_VITE_CHECKOUT_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: Build-${{ matrix.os }}
path: |
dist/win-unpacked/**
dist/*-portable.exe
dist/*.zip
dist/*.dmg
dist/*.deb
dist/*.rpm
dist/*.tar.gz
dist/*.yml
dist/*.blockmap
dist/*.pacman
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.vscode
node_modules
.vscode/
node_modules/
hydra-download-manager/
fastlist.exe
__pycache__
Expand All @@ -10,3 +10,4 @@ out
.env
.vite
sentry.properties
ludusavi/
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
[![build](https://img.shields.io/github/actions/workflow/status/hydralauncher/hydra/build.yml)](https://github.com/hydralauncher/hydra/actions)
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)

[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
[![es](https://img.shields.io/badge/lang-es-red)](README.es.md)
[![fr](https://img.shields.io/badge/lang-fr-blue)](README.fr.md)
[![de](https://img.shields.io/badge/lang-de-black)](README.de.md)
[![ita](https://img.shields.io/badge/lang-it-red)](README.it.md)
[![cs](https://img.shields.io/badge/lang-cs-purple)](README.cs.md)
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](./README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](./README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](./README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](./README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](./README.be.md)
[![es](https://img.shields.io/badge/lang-es-red)](./README.es.md)
[![fr](https://img.shields.io/badge/lang-fr-blue)](./README.fr.md)
[![de](https://img.shields.io/badge/lang-de-black)](./README.de.md)
[![ita](https://img.shields.io/badge/lang-it-red)](./README.it.md)
[![cs](https://img.shields.io/badge/lang-cs-purple)](./README.cs.md)
[![da](https://img.shields.io/badge/lang-da-red)](./README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](./README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)

Expand Down
2 changes: 1 addition & 1 deletion README.be.md → docs/README.be.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.cs.md → docs/README.cs.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Katalog](./docs/screenshot.png)
![Hydra Katalog](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.da.md → docs/README.da.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
[![cs](https://img.shields.io/badge/lang-cs-purple)](README.cs.md)
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.de.md → docs/README.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Katalog](./docs/screenshot.png)
![Hydra Katalog](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.es.md → docs/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.fr.md → docs/README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Catalogue Hydra](./docs/screenshot.png)
![Catalogue Hydra](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.it.md → docs/README.it.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.nb.md → docs/README.nb.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
[![cs](https://img.shields.io/badge/lang-cs-purple)](README.cs.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.pl.md → docs/README.pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.pt-BR.md → docs/README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.ru.md → docs/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
2 changes: 1 addition & 1 deletion README.uk-UA.md → docs/README.uk-UA.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)

![Hydra Catalogue](./docs/screenshot.png)
![Hydra Catalogue](./screenshot.png)

</div>

Expand Down
1 change: 1 addition & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ productName: Hydra
directories:
buildResources: build
extraResources:
- ludusavi
- hydra-download-manager
- seeds
- from: node_modules/create-desktop-shortcuts/src/windows.vbs
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hydralauncher",
"version": "2.1.7",
"version": "3.0.0",
"description": "Hydra",
"main": "./out/main/index.js",
"author": "Los Broxas",
Expand All @@ -23,7 +23,7 @@
"start": "electron-vite preview",
"dev": "electron-vite dev",
"build": "npm run typecheck && electron-vite build",
"postinstall": "electron-builder install-app-deps",
"postinstall": "electron-builder install-app-deps && node ./postinstall.cjs",
"build:unpack": "npm run build && electron-builder --dir",
"build:win": "electron-vite build && electron-builder --win",
"build:mac": "electron-vite build && electron-builder --mac",
Expand All @@ -44,34 +44,34 @@
"@vanilla-extract/recipes": "^0.5.2",
"auto-launch": "^5.0.6",
"axios": "^1.7.7",
"better-sqlite3": "^11.2.1",
"better-sqlite3": "^11.3.0",
"check-disk-space": "^3.4.0",
"classnames": "^2.5.1",
"color": "^4.2.3",
"color.js": "^1.2.0",
"create-desktop-shortcuts": "^1.11.0",
"date-fns": "^3.6.0",
"dexie": "^4.0.8",
"electron-log": "^5.1.4",
"electron-updater": "^6.1.8",
"fetch-cookie": "^3.0.1",
"electron-log": "^5.2.0",
"electron-updater": "^6.3.9",
"flexsearch": "^0.7.43",
"i18next": "^23.11.2",
"i18next-browser-languagedetector": "^7.2.1",
"icojs": "^0.19.3",
"icojs": "^0.19.4",
"jsdom": "^24.0.0",
"jsonwebtoken": "^9.0.2",
"knex": "^3.1.0",
"lodash-es": "^4.17.21",
"lottie-react": "^2.4.0",
"parse-torrent": "^11.0.16",
"parse-torrent": "^11.0.17",
"piscina": "^4.5.1",
"react-hook-form": "^7.53.0",
"react-i18next": "^14.1.0",
"react-loading-skeleton": "^3.4.0",
"react-redux": "^9.1.1",
"react-router-dom": "^6.22.3",
"sudo-prompt": "^9.2.1",
"tar": "^7.4.3",
"typeorm": "^0.3.20",
"user-agents": "^1.1.193",
"yaml": "^2.4.1",
Expand All @@ -88,6 +88,7 @@
"@swc/core": "^1.4.16",
"@types/auto-launch": "^5.0.5",
"@types/color": "^3.0.6",
"@types/folder-hash": "^4.0.4",
"@types/jsdom": "^21.1.6",
"@types/jsonwebtoken": "^9.0.6",
"@types/lodash-es": "^4.17.12",
Expand All @@ -99,7 +100,7 @@
"@vanilla-extract/vite-plugin": "^4.0.7",
"@vitejs/plugin-react": "^4.2.1",
"electron": "^30.3.0",
"electron-builder": "^24.9.1",
"electron-builder": "^25.1.8",
"electron-vite": "^2.0.0",
"eslint": "^8.56.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
Expand Down
49 changes: 49 additions & 0 deletions postinstall.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const { default: axios } = require("axios");
const util = require("node:util");
const fs = require("node:fs");
const path = require("node:path");

const exec = util.promisify(require("node:child_process").exec);

const fileName = {
win32: "ludusavi-v0.25.0-win64.zip",
linux: "ludusavi-v0.25.0-linux.zip",
darwin: "ludusavi-v0.25.0-mac.zip",
};

const downloadLudusavi = async () => {
if (fs.existsSync("ludusavi")) {
console.log("Ludusavi already exists, skipping download...");
return;
}

const file = fileName[process.platform];
const downloadUrl = `https://github.com/mtkennerly/ludusavi/releases/download/v0.25.0/${file}`;

console.log(`Downloading ${file}...`);

const response = await axios.get(downloadUrl, { responseType: "stream" });

const stream = response.data.pipe(fs.createWriteStream(file));

stream.on("finish", async () => {
console.log(`Downloaded ${file}, extracting...`);

const pwd = process.cwd();

const targetPath = path.join(pwd, "ludusavi");

await exec(`npx extract-zip ${file} ${targetPath}`);

if (process.platform !== "win32") {
fs.chmodSync(path.join(targetPath, "ludusavi"), 0o755);
}

console.log("Extracted. Renaming folder...");

console.log(`Extracted ${file}, removing compressed downloaded file...`);
fs.rmSync(file);
});
};

downloadLudusavi();
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
libtorrent
cx_Freeze
cx_Logging; sys_platform == 'win32'
lief; sys_platform == 'win32'
pywin32; sys_platform == 'win32'
psutil
Pillow
Binary file added resources/achievement-sound.mp3
Binary file not shown.
Loading

0 comments on commit 9c59558

Please sign in to comment.