Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
215 lines (174 loc) · 8.73 KB
/
Copy pathjustfile
File metadata and controls
215 lines (174 loc) · 8.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# Tempest task runner. `just` lists everything; recipes are grouped per project.
#
# Override tools via env: ZIG=zign just utils (zig <0.16 on macOS 26 needs the zign wrapper)
zig_detected := `command -v zign >/dev/null 2>&1 && echo zign || echo zig`
zig := env("ZIG", zig_detected)
scripting := "Tempest.Scripting"
unrealscript := "Tempest.UnrealScript"
launcher := "Tempest.Launcher"
# `dotnet run` of the CLI; the Web SDK would run it from Tempest.CLI/, so relative paths resolve from where just was invoked
tempest := 'dotnet run --project "' + justfile_directory() / "Tempest.CLI" + '" -p:RunWorkingDirectory="' + invocation_directory() + '"'
# R2 folder behind https://cdn.lowrezstudio.com/keys/ (rclone remote:bucket/path)
r2_keys := env("TEMPEST_R2_KEYS", "lowrezstudio:lowrezstudio-cdn/keys")
default:
@just --list --unsorted
# ---------------------------------------------------------------------------
# Tempest.Utils (Zig): asmloader, upkpatcher, mctsparser -> Tempest.Utils/zig-out/bin
# ---------------------------------------------------------------------------
# Build the native utils (Debug by default; ReleaseFast / ReleaseSmall / ReleaseSafe).
# Builds both zig packages: the root one (asmloader + upkpatcher, zig 0.15) and
# the utils/ sub-package (upk-parser with compression, newer zig — anyzig
# resolves each version from its build.zig.zon). Builds run from their package
# directories: zig's --build-file-from-outside form breaks the relative cache.
[group("utils")]
utils optimize="Debug":
cd Tempest.Utils && {{zig}} build -Doptimize={{optimize}}
cd Tempest.Utils/utils && zig build -Doptimize={{optimize}}
# Release utils, size-optimised (what the launcher bundle ships)
[group("utils")]
utils-release: (utils "ReleaseSmall")
# ---------------------------------------------------------------------------
# Tempest.Scripting (Rust): Lua modding DLL for the Paladins 8.1 Win64 and Win32 clients
# ---------------------------------------------------------------------------
# Host tests (no game image needed)
[group("scripting")]
scripting-test:
cd {{scripting}} && cargo test -p tempest-scripting
# Clippy for the host and both Windows targets (the i686 one builds LuaJIT's host tools under wine)
[group("scripting")]
scripting-check:
cd {{scripting}} && cargo clippy -p tempest-scripting --all-targets
cd {{scripting}} && cargo clippy -p tempest-scripting --target x86_64-pc-windows-gnu
cd {{scripting}} && HOST_CC="{{justfile_directory()}}/{{scripting}}/scripts/luajit-hostcc32.sh" cargo clippy -p tempest-scripting --target i686-pc-windows-gnu
# Build Tempest.Scripting64.dll + Tempest.Scripting32.dll and stage dist/: scripting / console / dev / lib .tempest packages,
# signed with the mod signing key when there is one (TEMPEST_SCRIPTING_TARGETS="64" or "32" builds one client only)
[group("scripting")]
scripting-build:
{{scripting}}/scripts/package.sh
# Launch the game with the freshly built DLLs injected directly (no mod install);
# the CLI injects the one matching the executable (pass --platform Win32 for the 32-bit client)
[group("scripting")]
scripting-run game *args: scripting-build
dotnet run --project Tempest.CLI -- launch "{{game}}" --dll "{{justfile_directory()}}/{{scripting}}/dist/scripting/dlls/64/Tempest.Scripting64.dll" --dll "{{justfile_directory()}}/{{scripting}}/dist/scripting/dlls/32/Tempest.Scripting32.dll" {{args}}
# ---------------------------------------------------------------------------
# Mod signing (Tempest CLI). Mods with code (DLLs, Lua) must be signed; only keys from keys/trusted.keys
# (published to the CDN, built into the CLI as fallback) install without a warning. The signing key is
# $TEMPEST_SIGNING_KEY, else <app data>/com.lowrezstudio.tempest/signing/tempest.key; scripting-build signs with it too.
# ---------------------------------------------------------------------------
# Generate the signing keypair (never overwrites); add the .pub to keys/trusted.keys and `just keys-publish` to trust it everywhere
[group("mods")]
mod-keygen id="tempest@lowrez.studio":
{{tempest}} -- mod gen-key --id "{{id}}"
# Package a mod folder (manifest.toml at its root) into a signed .tempest
[group("mods")]
mod-pack dir out:
{{tempest}} -- mod pack "{{dir}}" "{{out}}"
{{tempest}} --no-build -- mod sign "{{out}}"
# Sign a text with the mod signing key and print the armored signature (mods.lowrezstudio.com key verification)
[group("mods")]
mod-sign-text text:
{{tempest}} -- mod sign-text "{{text}}"
# Sign existing .tempest packages in place (rewrites CHECKSUMS + CHECKSUMS.asc)
[group("mods")]
[positional-arguments]
mod-sign +packages:
#!/usr/bin/env bash
set -euo pipefail
dotnet build Tempest.CLI -v q -nologo
for pkg in "$@"; do {{tempest}} --no-build -- mod sign "$pkg"; done
# Report who signed a .tempest and whether this CLI trusts them (exit 1 unless trusted)
[group("mods")]
mod-verify package:
{{tempest}} -- mod verify "{{package}}"
# Sign keys/trusted.keys + keys/untrusted.keys after editing them (needs a list-signing key, see Tempest.CLI/Mods/TrustStore.cs)
[group("mods")]
keys-sign:
{{tempest}} -- mod sign-key-lists "{{justfile_directory()}}/keys"
# Sign the key lists and upload them to cdn.lowrezstudio.com/keys/ (rclone, R2), then show what the CLI now trusts
[group("mods")]
keys-publish: keys-sign
rclone copy "{{justfile_directory()}}/keys" "{{r2_keys}}" --include "*.keys" --include "*.keys.asc" --header-upload "Cache-Control: public, max-age=300"
{{tempest}} --no-build -- mod key-lists
# Where the key lists are fetched from and what is trusted / revoked right now
[group("mods")]
keys-status:
{{tempest}} -- mod key-lists
# ---------------------------------------------------------------------------
# Tempest.UnrealScript (Rust UnrealScript compiler / decompiler, CLI `uscript`)
# ---------------------------------------------------------------------------
# Release build of the `uscript` CLI (target/release/uscript)
[group("unrealscript")]
unrealscript-build:
cd {{unrealscript}} && cargo build --release
# Unit tests + clippy
[group("unrealscript")]
unrealscript-check:
cd {{unrealscript}} && cargo test --release
cd {{unrealscript}} && cargo clippy --release --all-targets
# Round-trip every script package of a cooked game dir and compare with the originals
[group("unrealscript")]
unrealscript-verify cooked:
{{unrealscript}}/scripts/verify.sh "{{cooked}}"
# Run the CLI: just uscript info <pkg>, just uscript project build <dir> ...
[group("unrealscript")]
uscript *args: unrealscript-build
{{unrealscript}}/target/release/uscript {{args}}
# ---------------------------------------------------------------------------
# .NET: Tempest.CLI, Tempest.Services, MarshalLib, Tempest.Protocol
# ---------------------------------------------------------------------------
# Build the whole solution (also compiles Tempest.CLI/inject via zig)
[group("dotnet")]
build:
dotnet build Tempest.slnx
# Run the CLI, e.g. `just cli mod list <game>` / `just cli launch <game>`
[group("dotnet")]
cli *args:
{{tempest}} -- {{args}}
# AOT publish of the CLI -> Tempest.CLI/bin/Release/net10.0/publish/
[group("dotnet")]
publish-cli:
dotnet publish -c Release Tempest.CLI
# Run the gRPC services server
[group("dotnet")]
services:
dotnet run --project Tempest.Services
# ---------------------------------------------------------------------------
# Tempest.Launcher (Tauri / Electron + SvelteKit)
# ---------------------------------------------------------------------------
# pnpm install (enables corepack first)
[group("launcher")]
launcher-install:
corepack enable
cd {{launcher}} && pnpm install
# Electron dev app (needs the CLI built first)
[group("launcher")]
launcher-dev: build
cd {{launcher}} && pnpm electron:dev
# Production Electron build -> Tempest.Launcher/dist/
[group("launcher")]
launcher-build:
cd {{launcher}} && pnpm electron:build
# svelte-check (renderer), electron typecheck (host), oxlint
[group("launcher")]
launcher-check:
cd {{launcher}} && pnpm check
cd {{launcher}} && pnpm check:electron
cd {{launcher}} && pnpm lint
# oxfmt
[group("launcher")]
launcher-fmt:
cd {{launcher}} && pnpm fmt
# Regenerate TS protobuf clients from Tempest.Protocol
[group("launcher")]
launcher-proto: build
cd {{launcher}} && pnpm proto-generate
# Version bump + annotated tag (prompts; see AGENTS.md "Releasing")
[group("launcher")]
bump:
cd {{launcher}} && pnpm bump
# ---------------------------------------------------------------------------
# Everything
# ---------------------------------------------------------------------------
# All verification that runs without a game: .NET build, scripting tests + clippy, launcher check
[group("all")]
check: build scripting-test scripting-check unrealscript-check launcher-check