build: offload binary assets to TRX-data
4
.github/workflows/job_build_tr1.yml
vendored
|
@ -32,6 +32,10 @@ jobs:
|
|||
name: Prepare variables
|
||||
run: echo "version=$(just output-current-version 1)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download large assets
|
||||
if: ${{ inputs.target == 'release' }}
|
||||
run: just download-assets 1
|
||||
|
||||
- name: Package asset (${{ inputs.platform }})
|
||||
run: just tr1-package-${{ inputs.platform }} ${{ inputs.target }}
|
||||
|
||||
|
|
4
.github/workflows/job_build_tr2.yml
vendored
|
@ -32,6 +32,10 @@ jobs:
|
|||
name: Prepare variables
|
||||
run: echo "version=$(just output-current-version 2)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download large assets
|
||||
if: ${{ inputs.target == 'release' }}
|
||||
run: just download-assets 2
|
||||
|
||||
- name: Package asset (${{ inputs.platform }})
|
||||
run: just tr2-package-${{ inputs.platform }} ${{ inputs.target }}
|
||||
|
||||
|
|
4
.gitignore
vendored
|
@ -35,3 +35,7 @@ Release/
|
|||
**/subprojects/dwarfstack-*/
|
||||
src/tr1/subprojects/dwarfstack.wrap
|
||||
src/tr2/subprojects/dwarfstack.wrap
|
||||
|
||||
data/tr1/ship/data/images/
|
||||
data/tr2/ship/data/images/
|
||||
data/tr2/ship/music/
|
||||
|
|
Before Width: | Height: | Size: 2 MiB |
Before Width: | Height: | Size: 2.2 MiB |
Before Width: | Height: | Size: 2.3 MiB |
Before Width: | Height: | Size: 1.8 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 305 KiB |
Before Width: | Height: | Size: 2.2 MiB |
Before Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 413 KiB |
Before Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 2.7 MiB |
Before Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 2.3 MiB |
Before Width: | Height: | Size: 1.9 MiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 410 KiB |
Before Width: | Height: | Size: 346 KiB |
Before Width: | Height: | Size: 444 KiB |
Before Width: | Height: | Size: 322 KiB |
Before Width: | Height: | Size: 268 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 689 KiB |
Before Width: | Height: | Size: 592 KiB |
Before Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 669 KiB |
Before Width: | Height: | Size: 383 KiB |
Before Width: | Height: | Size: 701 KiB |
Before Width: | Height: | Size: 454 KiB |
Before Width: | Height: | Size: 628 KiB |
Before Width: | Height: | Size: 461 KiB |
Before Width: | Height: | Size: 314 KiB |
Before Width: | Height: | Size: 261 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 180 KiB |
|
@ -371,6 +371,16 @@ less like this (click to expand):
|
|||
</pre>
|
||||
</details>
|
||||
|
||||
## Dev snapshots
|
||||
|
||||
To ease the load on our infrastructure, the binary assets such as images and music files are not included in pre-releases and pull request preview builds - they only ship with the full release builds.
|
||||
However, you can easily download them manually from these urls:
|
||||
|
||||
- https://lostartefacts.dev/aux/tr1x/main.zip (main assets)
|
||||
- https://lostartefacts.dev/aux/tr1x/music.zip (music files)
|
||||
- https://lostartefacts.dev/aux/tr1x/trub-music.zip (TR: Unfinished Business expansion pack with fan-patched music)
|
||||
- https://lostartefacts.dev/aux/tr1x/trub-vanilla.zip (TR: Unfinished Business expansion pack in its original form)
|
||||
|
||||
## Improvements over original game
|
||||
|
||||
Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for details.
|
||||
|
|
|
@ -156,6 +156,15 @@ as Notepad.
|
|||
4. Find TR2X in your Applications folder. Right-click it and click "Show Package Contents".
|
||||
5. Copy your Tomb Raider 2 game data files into `Contents/Resources`.
|
||||
|
||||
## Dev snapshots
|
||||
|
||||
To ease the load on our infrastructure, the binary assets such as images and music files are not included in pre-releases and pull request preview builds - they only ship with the full release builds.
|
||||
However, you can easily download them manually from these urls:
|
||||
|
||||
- https://lostartefacts.dev/aux/tr2x/main.zip (main assets)
|
||||
- https://lostartefacts.dev/aux/tr2x/music.zip (music files)
|
||||
- https://lostartefacts.dev/aux/tr2x/trgm.zip (TR: The Golden Mask expansion pack)
|
||||
|
||||
## Improvements over original game
|
||||
|
||||
#### UI
|
||||
|
|
3
justfile
|
@ -49,6 +49,9 @@ push-image-win: (image-win "0") (_docker_push "rrdash/trx-win")
|
|||
import "justfile.tr1"
|
||||
import "justfile.tr2"
|
||||
|
||||
download-assets tr_version='all':
|
||||
tools/download_assets {{tr_version}}
|
||||
|
||||
output-release-name tr_version:
|
||||
tools/output_release_name {{tr_version}}
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ def filter_files(
|
|||
files: Iterable[Path], ignored_patterns: list[str] | None, debug: bool
|
||||
) -> Iterable[Path]:
|
||||
for path in files:
|
||||
if not path.exists():
|
||||
continue
|
||||
if path.is_dir():
|
||||
continue
|
||||
if is_binary_file(path):
|
||||
|
|
83
tools/download_assets
Executable file
|
@ -0,0 +1,83 @@
|
|||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from urllib.request import Request, urlopen
|
||||
from zipfile import ZipFile
|
||||
|
||||
from shared.paths import PROJECT_PATHS
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(
|
||||
description=(
|
||||
"Downloads large binary assets into local "
|
||||
"data/*/ship/ directories."
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"game_version", choices=["1", "2", "all"], default="all", nargs="?"
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def download_to_file(url: str, path: Path) -> None:
|
||||
print(f"Downloading {url}...")
|
||||
req = Request(url, headers={"User-Agent": "download_assets"})
|
||||
with urlopen(req) as response:
|
||||
if getattr(response, "status", None) not in (None, 200):
|
||||
sys.exit(
|
||||
f"Error: failed to download {url}. Status: {response.status}"
|
||||
)
|
||||
with path.open("wb") as f:
|
||||
shutil.copyfileobj(response, f)
|
||||
|
||||
|
||||
def extract_zip(zip_path: Path, dest_dir: Path) -> None:
|
||||
print(f"Extracting {zip_path} to {dest_dir}...")
|
||||
dest_dir.mkdir(parents=True, exist_ok=True)
|
||||
with ZipFile(zip_path) as z:
|
||||
z.extractall(dest_dir)
|
||||
|
||||
|
||||
def download_assets(assets: list[tuple[str, Path]]) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmpdir_str:
|
||||
tmpdir = Path(tmpdir_str)
|
||||
for url, dest in assets:
|
||||
filename = Path(url).name
|
||||
local_zip = tmpdir / filename
|
||||
download_to_file(url, local_zip)
|
||||
extract_zip(local_zip, dest)
|
||||
print("Asset download and extraction complete.")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = parse_args()
|
||||
assets: dict[int, list[tuple[str, Path]]] = {
|
||||
1: [
|
||||
(
|
||||
"https://lostartefacts.dev/aux/tr1x/main.zip",
|
||||
Path("data/tr1/ship"),
|
||||
)
|
||||
],
|
||||
2: [
|
||||
(
|
||||
"https://lostartefacts.dev/aux/tr2x/main.zip",
|
||||
Path("data/tr2/ship"),
|
||||
)
|
||||
],
|
||||
}
|
||||
match str(args.game_version):
|
||||
case "1":
|
||||
download_assets(assets[1])
|
||||
case "2":
|
||||
download_assets(assets[2])
|
||||
case "all":
|
||||
download_assets(assets[1])
|
||||
download_assets(assets[2])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|