docs: clarify reproducible setup and platform-specific builds

This commit is contained in:
dasemu committed 2026-10-26 08:52:54 +01:00
1 parent b55cf8242e
commit 008f78a82a
1 file changed
+108 -36
+108 -36
View File
@@ -1,22 +1,41 @@
# Running, linting and building the game
The Ren'Py project in `vn/` is generated by vnpipe (`../vnpipe`); never edit it by hand. All
commands run from the repository root. Generic details (CLI, GUI template, SDK commands):
`../vnpipe/docs/running.md`.
The Ren'Py project in `vn/` is generated by [vnpipe](https://github.com/Dasemu/vnpipe);
never edit it by hand. All commands below run from the repository root and use
**Bash on Linux x86-64**, matching the release runner. Other hosts need the corresponding
SDK launcher and bundled Python executable. Generic details:
[vnpipe running guide](https://github.com/Dasemu/vnpipe/blob/main/docs/running.md).
## 1. Ren'Py SDK
## 1. Clean clone and common setup
The SDK is not committed (`tools/` is gitignored). Install **Ren'Py 8.5.3** (SDK
archive from <https://www.renpy.org/latest.html>, `renpy-8.5.3-sdk.tar.bz2`) so that
`tools/renpy-sdk/renpy.sh` exists:
Install Git, [uv](https://docs.astral.sh/uv/), curl, tar (with bzip2 support) and unzip.
Python >=3.12 is required; uv can provision it.
```sh
mkdir -p tools && tar -xjf renpy-8.5.3-sdk.tar.bz2 -C tools && mv tools/renpy-8.5.3-sdk tools/renpy-sdk
```bash
git clone https://github.com/Dasemu/faust-vn.git
cd faust-vn
uv sync --locked
uv run vnpipe --work . renpy
```
The SDK already contains the web runtime (`tools/renpy-sdk/web`) and the Linux, Windows
and macOS distribution templates. Inside the sandbox set `HOME=$TMPDIR/renpy-home` for
SDK commands, since Ren'Py writes to `~/.renpy`.
vnpipe is a Git dependency pinned by `uv.lock`, not a sibling path dependency.
Do not change `[tool.uv.sources]` for normal use. To reproduce a specific release,
check out its tag before `uv sync --locked`. The committed inputs are sufficient;
fetching, parsing, annotating and rebuilding translations are optional content-development
tasks, not part of this startup path.
Install **Ren'Py 8.5.3** (the SDK is not committed; `tools/` is gitignored):
```bash
mkdir -p tools/renpy-sdk
curl -fsSL https://www.renpy.org/dl/8.5.3/renpy-8.5.3-sdk.tar.bz2 \
| tar -xj --strip-components=1 -C tools/renpy-sdk
```
This provides `tools/renpy-sdk/renpy.sh` and the desktop distribution templates.
Install the matching web or RAPT add-on only for that target (below).
The examples use this fixed SDK path; `RENPY_SDK` is also recognized by the Python tests,
but does not automatically replace paths in shell commands.
## 2. Regenerate the project
@@ -58,7 +77,7 @@ documentation assets.
## 3. Lint
```sh
HOME=$TMPDIR/renpy-home tools/renpy-sdk/renpy.sh vn lint
tools/renpy-sdk/renpy.sh vn lint
```
The expected result is a statistics block with no warnings above it.
@@ -94,50 +113,103 @@ main menu (one test run per scene); `ShowMenu("preferences")`, `"load"`, `"histo
`"vn_credits"`, `"vn_scene_select"` work anywhere. Set `persistent.art_style` with
`run SetField(persistent, "art_style", "anime")` (a bare `$` does not redraw).
## 4. Play
## 4. Desktop: play and package
```sh
After the common setup, launch the game:
```bash
tools/renpy-sdk/renpy.sh vn
```
## 5. Builds (output under `build/`, gitignored)
Build a desktop package (outputs are gitignored):
```sh
# Web (HTML5)
tools/renpy-sdk/renpy.sh tools/renpy-sdk/launcher web_build vn --destination build/web
python3 -m http.server -d build/web 8000 # then open http://localhost:8000
# Linux desktop
```bash
mkdir -p build/dist
tools/renpy-sdk/renpy.sh tools/renpy-sdk/launcher distribute vn --package linux --destination build/dist
```
`--package` also accepts `win` and `mac`; omit it to build every package. The web build
also leaves a `build/web.zip` next to the folder. A web build writes
`vn/progressive_download.txt`; delete it (it is not part of the generated project).
Use `win` or `mac` instead of `linux` for those targets. Extract the resulting package
on its target OS and run its launcher. Ren'Py is bundled in desktop distributions.
## 5. Web and Android builds
### Web (HTML5)
After the common setup, install the matching web add-on explicitly, as CI does:
```bash
curl -fsSL -o /tmp/faust-renpy-web.zip https://www.renpy.org/dl/8.5.3/renpy-8.5.3-web.zip
unzip -q /tmp/faust-renpy-web.zip -d tools/renpy-sdk
tools/renpy-sdk/renpy.sh tools/renpy-sdk/launcher web_build vn --destination build/web
rm -f vn/progressive_download.txt
uv run python -m http.server --bind 127.0.0.1 --directory build/web 8000
```
Open <http://localhost:8000>; serve the build over HTTP rather than opening its HTML
with `file://`. The build also creates `build/web.zip`.
`vn/progressive_download.txt` is temporary web-build output, not a source input.
### Android APK
One-time local setup: unpack `renpy-8.5.3-rapt.zip` into `tools/renpy-sdk/rapt`, use JDK 21
(`JAVA_HOME`), and install the Android SDK with RAPT's `android.py installsdk` (this accepts
Google's Android SDK licence). The `[android]` table in `work.toml` makes `vnpipe renpy` write
`vn/android.json`, the icons and the presplash.
After the common setup, install **JDK 21**, set `JAVA_HOME` to its installation and
put `$JAVA_HOME/bin` on `PATH`; check `java -version` reports 21.
Use ASCII-only absolute paths for the checkout and SDK (for example
`/home/dario/src/faust-vn`); Gradle's `local.properties` uses Latin-1.
If necessary, move or copy the checkout to such a path before setup.
```sh
Install RAPT 8.5.3 and its Android SDK once:
```bash
curl -fsSL -o /tmp/faust-renpy-rapt.zip https://www.renpy.org/dl/8.5.3/renpy-8.5.3-rapt.zip
unzip -q /tmp/faust-renpy-rapt.zip -d tools/renpy-sdk
(
cd tools/renpy-sdk/rapt
../lib/py3-linux-x86_64/python -c '
import runpy, sys
sys.path[:0] = [".."]
sys.argv = ["android.py", "installsdk"]
runpy.run_path("android.py", run_name="__main__")
'
)
```
Review and accept the Android SDK licences when prompted. The `[android]` table in
`work.toml` makes vnpipe generate `vn/android.json`, icons and presplash.
For an update to an existing release, restore its private signing key as both
`vn/android.keystore` and `vn/bundle.keystore` **before** building
(alias `android`, password `android`). For a first independent local build,
RAPT creates keys when absent; back them up. Both files are gitignored.
Always reuse the same signing key for updates and never commit it.
```bash
mkdir -p build/dist
tools/renpy-sdk/renpy.sh tools/renpy-sdk/launcher android_build vn --destination build/dist
```
- Signing: copy the release keystore to `vn/android.keystore` and `vn/bundle.keystore` (alias
`android`, password `android`; both are gitignored). Always sign with the **same** keystore:
a different one cannot update an installed app. Keep a private backup; never commit it.
- The project path must be ASCII (Gradle's `local.properties` is Latin-1): from a path with
accents such as `Darío`, build from a copy of `vn/` in an ASCII directory.
Transfer the APK from `build/dist` to the Android device, permit installation from
that source and install it. An APK signed with a different key cannot update the
official installed app.
### Developing vnpipe itself (optional)
A separate checkout can live anywhere. To try unpublished changes without editing
the project's source configuration or upgrading its lockfile:
```bash
uv run --with-editable /absolute/path/to/vnpipe vnpipe --work . renpy
```
Maintainers intentionally updating the pinned dependency run
`uv lock --upgrade-package vnpipe` after pushing the upstream changes, then review
and commit the updated lockfile.
## 6. Releases (CI)
`.github/workflows/release.yml` builds Windows, Linux, macOS, web and the signed APK.
- Push to `development` or a manual run: builds are kept as workflow artifacts (7 days).
- Merge `development` into `main`: `version.yml` bumps the version, then `release.yml`
publishes the GitHub release `vMAJOR.MINOR.PATCH` with all five files.
publishes the GitHub release `vMAJOR.MINOR.PATCH` with desktop and web files (and the APK when signing is configured).
- The APK needs the `ANDROID_KEYSTORE_B64` repository secret
(`base64 -w0 android.keystore | gh secret set ANDROID_KEYSTORE_B64`); without it the
Android build is skipped.