mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: game archive mounting
This commit is contained in:
1 parent
15b6ff43c5
commit
adc1791f56
3 files changed
+39
-40
No files matched your search
@@ -68,56 +68,65 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- if: github.event.inputs.zip_url != ''
|
- if: github.event.inputs.archive_url != ''
|
||||||
uses: easimon/maximize-build-space@master
|
uses: easimon/maximize-build-space@master
|
||||||
with:
|
with:
|
||||||
root-reserve-mb: 512
|
root-reserve-mb: 512
|
||||||
swap-size-mb: 1024
|
swap-size-mb: 1024
|
||||||
remove-dotnet: "true"
|
remove-dotnet: "true"
|
||||||
|
remove-haskell: "true"
|
||||||
|
remove-android: "true"
|
||||||
|
remove-codeql: "true"
|
||||||
|
remove-docker-images: "true"
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
if: github.event.inputs.archive_url == ''
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
token: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- uses: arduino/setup-protoc@v3
|
- uses: arduino/setup-protoc@v3
|
||||||
|
if: github.event.inputs.archive_url == ''
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
repo-token: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
- uses: oven-sh/setup-bun@v1
|
||||||
if: github.event.inputs.zip_url == ''
|
if: github.event.inputs.archive_url == ''
|
||||||
- if: github.event.inputs.zip_url == ''
|
|
||||||
run: bun run setup
|
- run: bun run setup
|
||||||
|
if: github.event.inputs.archive_url == ''
|
||||||
|
|
||||||
- name: (Steam) Setup DepotDownloader
|
- name: (Steam) Setup DepotDownloader
|
||||||
if: github.event.inputs.zip_url == ''
|
if: github.event.inputs.archive_url == ''
|
||||||
run: bun run setup:depotdownloader
|
run: bun run setup:depotdownloader
|
||||||
|
|
||||||
- name: (Steam) Download client
|
- name: (Steam) Download client
|
||||||
if: github.event.inputs.zip_url == ''
|
if: github.event.inputs.archive_url == ''
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./temp/depotDownloader/DepotDownloader
|
chmod +x ./temp/depotDownloader/DepotDownloader
|
||||||
./temp/depotDownloader/DepotDownloader -q -os windows -app 444200 -username ${{ secrets.DEPOT_DOWNLOADER_USERNAME }} -password "${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}"
|
./temp/depotDownloader/DepotDownloader -q -os windows -app 444200 -username ${{ secrets.DEPOT_DOWNLOADER_USERNAME }} -password "${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}"
|
||||||
|
|
||||||
- name: (Steam) Apply patches
|
- name: (Steam) Apply patches
|
||||||
if: github.event.inputs.zip_url == ''
|
if: github.event.inputs.archive_url == ''
|
||||||
run: bun setup:patches --depot
|
run: bun setup:patches --depot
|
||||||
|
|
||||||
- name: (ZIP) Download client
|
- name: (ZIP) Download client
|
||||||
if: github.event.inputs.zip_url != ''
|
if: github.event.inputs.archive_url != '' && endsWith(github.event.inputs.archive_url, '.zip')
|
||||||
env:
|
env:
|
||||||
ZIP_URL: ${{ github.event.inputs.zip_url }}
|
ARCHIVE_URL: ${{ github.event.inputs.archive_url }}
|
||||||
ZIP_ROOT: ${{ github.event.inputs.zip_root }}
|
ARCHIVE_ROOT: ${{ github.event.inputs.archive_root }}
|
||||||
run: |
|
run: |
|
||||||
wget -q -O client.zip $ZIP_URL
|
wget -q -O temp/archive.zip $ARCHIVE_URL
|
||||||
unzip -q client.zip -d client
|
unzip -q temp/archive.zip -d temp/archive
|
||||||
rm client.zip
|
rm temp/archive.zip
|
||||||
mkdir -p depots/444202/0
|
mkdir -p temp/game
|
||||||
mv client/$ZIP_ROOT/* depots/444202/0
|
mv temp/archive/$ARCHIVE_ROOT/* temp/game
|
||||||
|
|
||||||
- name: Archive depots
|
- name: Archive game
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: depots
|
name: game
|
||||||
path: depots
|
path: temp/game
|
||||||
|
|
||||||
build_assets:
|
build_assets:
|
||||||
name: Build assets
|
name: Build assets
|
||||||
@@ -135,20 +144,14 @@ jobs:
|
|||||||
- uses: oven-sh/setup-bun@v1
|
- uses: oven-sh/setup-bun@v1
|
||||||
- run: bun run setup
|
- run: bun run setup
|
||||||
|
|
||||||
- name: Download depots
|
- name: Download game
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: depots
|
name: game
|
||||||
path: depots
|
path: temp/game
|
||||||
|
|
||||||
- name: AppArmor hack
|
- name: AppArmor hack
|
||||||
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
|
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
|
||||||
|
|
||||||
- name: Start server and build assets
|
- name: Start server and build assets
|
||||||
run: |
|
run: bun run build:assets --all-targets --manual
|
||||||
bun dev:website --verbosepa &
|
|
||||||
SERVER_PID=$!
|
|
||||||
|
|
||||||
bun run build:assets --all-targets --depot --production
|
|
||||||
|
|
||||||
kill $SERVER_PID || true
|
|
||||||
Vendored
+1
@@ -66,6 +66,7 @@
|
|||||||
"decompressor",
|
"decompressor",
|
||||||
"defence",
|
"defence",
|
||||||
"degressive",
|
"degressive",
|
||||||
|
"depotdownloader",
|
||||||
"devkrieg",
|
"devkrieg",
|
||||||
"diacriticless",
|
"diacriticless",
|
||||||
"DIDS",
|
"DIDS",
|
||||||
|
|||||||
@@ -1,30 +1,25 @@
|
|||||||
import { readdir } from 'fs/promises';
|
import { readdir } from "fs/promises";
|
||||||
import { argv } from 'process';
|
import { argv } from "process";
|
||||||
|
|
||||||
const WINDOWS_APPS = 'C:/Program Files/WindowsApps';
|
const WINDOWS_APPS = "C:/Program Files/WindowsApps";
|
||||||
const wotbPackageRegex = /7458BE2C\..+_\d+(\.\d+)+_x64__.+/;
|
const wotbPackageRegex = /7458BE2C\..+_\d+(\.\d+)+_x64__.+/;
|
||||||
|
|
||||||
const isDepot = argv.includes('--depot');
|
const isManual = argv.includes("--manual");
|
||||||
const isManual = argv.includes('--manual');
|
|
||||||
|
|
||||||
let data: string;
|
let data: string;
|
||||||
let compressed: boolean;
|
let compressed: boolean;
|
||||||
|
|
||||||
if (isManual) {
|
if (isManual) {
|
||||||
data = '../../temp/game/Data';
|
data = "../../temp/game/Data";
|
||||||
compressed = true;
|
|
||||||
} else if (isDepot) {
|
|
||||||
const [installationVersion] = await readdir(`../../depots/444202`);
|
|
||||||
data = `../../depots/444202/${installationVersion}/Data`;
|
|
||||||
compressed = true;
|
compressed = true;
|
||||||
} else {
|
} else {
|
||||||
const directories = await readdir(WINDOWS_APPS).then((files) =>
|
const directories = await readdir(WINDOWS_APPS).then((files) =>
|
||||||
files.filter((file) => wotbPackageRegex.test(file)),
|
files.filter((file) => wotbPackageRegex.test(file))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (directories.length !== 1) {
|
if (directories.length !== 1) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Expected 1 directory for WoTB Windows App, got ${directories.length}.`,
|
`Expected 1 directory for WoTB Windows App, got ${directories.length}.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user