Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Check
run: >-
./gradlew --console=plain
:core:check :game:check :tools:check :terminal:check :web-common:check
:core:check :game:check :tools:check :web-common:check
:runtime:check :runtime-web:check :runtime-bitmap-web:check

- name: Upload test reports
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ jobs:
uses: docker/build-push-action@v7
with:
context: .
file: deploy/docker/Dockerfile.bitmap-production
file: deploy/docker/Dockerfile.bitmap
platforms: linux/amd64
load: true
tags: rylween:smoke

# Waits for the server to answer, as deploy.sh does (/api/status answers 401 without a
# Waits for the server to answer, as ./rylween serve does (/api/status answers 401 without a
# login), and checks the version in the server log's first line.
- name: Smoke-test the image
run: |
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
uses: docker/build-push-action@v7
with:
context: .
file: deploy/docker/Dockerfile.bitmap-production
file: deploy/docker/Dockerfile.bitmap
platforms: linux/amd64,linux/arm64
push: ${{ !inputs.dry-run }}
tags: |
Expand All @@ -217,16 +217,19 @@ jobs:
if: ${{ !inputs.dry-run }}
run: git push --atomic origin HEAD:refs/heads/main "refs/tags/v$RELEASE"

# The checked-in compose.yaml builds the image from a checkout. The release's copy pulls
# this release's image instead, and its compose.https.yaml pins that image too.
# The checked-in compose.yaml builds the images from a checkout. The release's copy pulls
# this release's bitmap image instead, without the ANSI game, which releases do not
# publish, and its compose.https.yaml pins the same image.
- name: Write the release's compose files
run: |
{
echo "# Adventurers of Rylween $RELEASE. \`docker compose up -d\` next to this file pulls"
echo "# $IMAGE:$RELEASE; the notes below on --build and deploy.sh are for a source checkout."
echo "# $IMAGE:$RELEASE; the notes below on --build, the ANSI game, and ./rylween are for a"
echo "# source checkout."
echo "#"
yq --indent 4 \
'.services.rylween.image = strenv(IMAGE) + ":" + strenv(RELEASE) | del(.services.rylween.build)' \
'.services.rylween.image = strenv(IMAGE) + ":" + strenv(RELEASE) | del(.services.rylween.build)
| del(.services.rylween-ansi) | del(.volumes.ansi-data)' \
deploy/compose.yaml
} > "$DIST/compose.yaml"
{
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ node_modules/
# Local compose settings; may hold account passwords.
.env

# Python tooling (support/audio)
# Python tooling (game/audio-tools)
__pycache__/
.venv/
60 changes: 31 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ with [`deploy/README.md`](deploy/README.md), change the game with the
Each pair below is the same moment in the same game: the title screen, a
party at dawn in the wilderness just north of Thord, and the tavern in Thord.
The ANSI version keeps the look of the 1993 original and plays in a terminal
with `./bin/run.sh`; the bitmap version is what `./deploy.sh` serves to browsers.
with `./rylween`; the bitmap version is what `./rylween serve` serves to browsers.

<table>
<tr>
Expand Down Expand Up @@ -81,32 +81,34 @@ brew install podman && podman machine init --now # Podman, and the Linux VM it
brew install --cask docker # or Docker Desktop; start it once from Applications
```

### On Your Network: `./deploy.sh`
### On This Machine Or Your Network: `./rylween serve`

```sh
./deploy.sh
./rylween serve # this machine only, http://127.0.0.1:8081/
./rylween serve --lan # every machine on the local network
```

From a checkout, this builds the bitmap game's image, starts it with Docker
Compose (Podman Compose when Docker is missing) on this machine's LAN address,
port 8081, and waits until it answers. Then it prints the address to open on any
machine on the network, with the commands for the sysop password, the server
log, and stopping it. Saves and accounts survive rebuilds.
Compose (Podman Compose when Docker is missing) on port 8081, and waits until it
answers. Then it prints the address to open, with the commands for the sysop
password, the server log, and stopping it. Saves and accounts survive rebuilds.
It serves only this machine (`--local`) unless `--lan` shares it on this
machine's LAN address; `./rylween stop` stops it.

### On The Internet, Over HTTPS

On a machine with a public address and a domain name, `./deploy.sh --https`,
On a machine with a public address and a domain name, `./rylween serve --https`,
or `deploy/compose.https.yaml` on its own, runs the released game behind Caddy,
which gets a Let's Encrypt certificate for the name.

[`deploy/README.md`](deploy/README.md) covers all three ways: the settings,
data and backups, and the images, and, step by step, everything an HTTPS server
needs, from DNS and ports on.
[`deploy/README.md`](deploy/README.md) covers all three ways: the `./rylween`
command and its defaults, the settings, data and backups, and the images, and,
step by step, everything an HTTPS server needs, from DNS and ports on.

### In A Terminal: `./bin/run.sh`
### In A Terminal: `./rylween`

```sh
./bin/run.sh --build
./rylween
```

This builds the game and plays the ANSI version in the current terminal. It
Expand All @@ -121,8 +123,9 @@ arrow keys or the keypad digits 8, 2, 4, and 6; press `?` in the wilderness for
the full list of commands, and `X` to quit. The save and logs go to
`~/.rylween/data`.

[`bin/README.md`](bin/README.md) lists the other launchers and their options,
such as starting with a seeded Strong party, and the local web servers.
[`deploy/README.md`](deploy/README.md#playing-in-a-terminal) lists its options,
such as starting with a seeded Strong party, and `./rylween help` lists every
option of every command.

The game streams ANSI escape codes (color, cursor positioning) and uses
ambiguous-width Unicode characters in some art. How those characters are
Expand All @@ -149,7 +152,7 @@ of the next patch release, `X.Y.Z-SNAPSHOT`; see [Releasing](#releasing).
The current runnable Kotlin game is the `:runtime` project. Shared
DSL/compiler and compiled-bundle contracts live under `:core`, authored game
DSL and resources live under `:game`, the compiled-bundle emitter and its checks
live under `:tools`, and ANSI terminal primitives live under `:terminal`.
live under `:tools`, and ANSI terminal primitives live in `:runtime`.

The complete game DSL, the whole authored game from the world map and monsters
to every mission script, is
Expand All @@ -168,13 +171,11 @@ Module guides:
- [`:runtime`](runtimes/runtime/README.md) - shared game runtime and direct ANSI terminal.
- [`:runtime-web`](runtimes/runtime-web/README.md) - browser-served ANSI runtime.
- [`:runtime-bitmap-web`](runtimes/runtime-bitmap-web/README.md) - canvas bitmap runtime.
- [`:web-common`](support/web-common/README.md) - shared web HTTP, WebSocket, auth, status.
- [`:terminal`](support/terminal/README.md) - ANSI terminal primitives.
- [`:tools`](support/tools/README.md) - emits, checks, and inspects the compiled bundle.
- [`support/audio`](support/audio) - Python scripts that synthesize the sound effects, music, and ambient loops.
- [`:web-common`](runtimes/web-common/README.md) - shared web HTTP, WebSocket, auth, status.
- [`:tools`](tools/README.md) - emits, checks, and inspects the compiled bundle.
- [`game/audio-tools`](game/audio-tools) - Python scripts that synthesize the sound effects, music, and ambient loops.
- [`build-logic`](build-logic/README.md) - Gradle conventions and custom tasks.
- [`bin`](bin/README.md) - local developer/operator launcher scripts.
- [`deploy`](deploy/README.md) - running the game as a server: compose files, Docker images, the deploy script, and HTTPS.
- [`deploy`](deploy/README.md) - running the game: the `rylween` command, compose files, Docker images, and HTTPS.

The old interpreted Kotlin ANSI project and the historical C/JSON5 port are no
longer part of this repository. The original Amiga release is kept as described
Expand All @@ -200,7 +201,7 @@ CI (`.github/workflows/ci.yml`) runs the module checks on every push to `main`
and every pull request, leaving out the root dependency-update report:

```sh
./gradlew --console=plain :core:check :game:check :tools:check :terminal:check :web-common:check :runtime:check :runtime-web:check :runtime-bitmap-web:check
./gradlew --console=plain :core:check :game:check :tools:check :web-common:check :runtime:check :runtime-web:check :runtime-bitmap-web:check
```

ktlint findings fail `check`; `./gradlew ktlintFormat --console=plain` fixes
Expand Down Expand Up @@ -229,11 +230,12 @@ bitmap web game as the image `ghcr.io/lagergren/rylween:X.Y.Z` (also `:latest`)
for linux/amd64 and linux/arm64, and the terminal game as
`rylween-terminal-X.Y.Z.zip` (`./gradlew :runtime:terminalDistZip`), which runs
with `bin/rylween` on Java 25 or newer. It then moves `main` to
`X.Y.(Z+1)-SNAPSHOT` and publishes the GitHub release with the zip and a
`compose.yaml` that pulls the image. It refuses a version without `-SNAPSHOT`
and a version that is tagged already. For a minor or major release, first set
`rylween.version` to its snapshot, such as `X.(Y+1).0-SNAPSHOT`, in a pull
request.
`X.Y.(Z+1)-SNAPSHOT` and publishes the GitHub release with the zip, a
`compose.yaml` that pulls the image, and a `compose.https.yaml` that runs it
behind Caddy and HTTPS, both pinned to the release. It refuses a version
without `-SNAPSHOT` and a version that is tagged already. For a minor or major
release, first set `rylween.version` to its snapshot, such as
`X.(Y+1).0-SNAPSHOT`, in a pull request.

`main` takes only pull requests, so the workflow pushes its commits with a
deploy key that the "Require PRs and CI on main" ruleset lets bypass that, kept
Expand All @@ -244,7 +246,7 @@ in the `RELEASE_DEPLOY_KEY` repository secret.
Generated files are Gradle build output, local Kotlin compiler caches, the
direct launcher's default saves and logs under `build/`, and the bitmap web
client's `node_modules` and downloaded Node.js under `runtimes/runtime-bitmap-web/`.
The `bin/` scripts keep saves and logs in `~/.rylween/data`. From the repo root:
`./rylween` keeps saves and logs in `~/.rylween/data`. From the repo root:

```sh
./gradlew clean --console=plain
Expand Down
100 changes: 0 additions & 100 deletions bin/README.md

This file was deleted.

88 changes: 0 additions & 88 deletions bin/backup-web-data.sh

This file was deleted.

Loading
Loading