Repository navigation
Publishing a mod
Players install mods from the Mods tab of the game's settings: the mods of the catalog, and any other GitHub repository from its link. A mod is a public GitHub repository, and what's installed is its latest release.
| Asset | |
|---|---|
mod.zip |
The mod's folder: init.lua at its root (or inside one top folder) with its other files |
mod.lua |
Instead of the zip, for a mod made of one file |
mod.zip.sig, mod.lua.sig
|
Your signature of the asset, needed for the catalog |
There's no manifest: the repository's name is the mod's name, the release's tag its version, and the README describes it. The zip is at most 32 MB, 64 MB unpacked in 512 files.
The mod is installed in phigros++/installed/<owner>/<name>/, which each new release replaces whole. Keep what your
mod saves in setting() or elsewhere under phigrospp.root.
local sprite = image("logo.png") -- files are found next to the file naming them, as in mods/
local util = require("util") -- util.lua of your mod's own folder, before any other mod's
local dir = phigrospp.dir() -- your mod's folder, for anything elseWrite it as mods/<name>/init.lua on your device (Your first mod): it runs the same once installed.
node sign-mod.mjs --keygen
MOD_KEY=<seed> node sign-mod.mjs <owner>/<repo> <tag> mod.zip
scripts/sign-mod.mjs only needs node.
--keygen prints a new Ed25519 key: keep the seed secret, the public half is what players' games check. Signing writes
mod.zip.sig: your public key, then the signature of the repository, the tag and the asset's SHA-512, so it's only
good for this release of this mod.
A workflow that releases a signed zip of the repository when a tag is pushed, with the seed in the repository's
MOD_KEY secret:
on:
push:
tags: ["*"]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: zip -r mod.zip . -x '.git*' README.md
- run: curl -fsSLO https://raw.githubusercontent.com/ggmolly/PhigrosPlusPlus/main/scripts/sign-mod.mjs
- run: node sign-mod.mjs "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" mod.zip
env:
MOD_KEY: ${{ secrets.MOD_KEY }}
- run: gh release create "$GITHUB_REF_NAME" mod.zip mod.zip.sig --generate-notes
env:
GH_TOKEN: ${{ github.token }}Open a pull request on registry.txt adding your
key once and a line per mod, in lowercase:
<owner>:<your public key>
<owner>/<repo>
Once it's merged, phigros.tools follows the repository: a new release shows in the game and on phigros.tools/mods within a quarter of an hour, with no other pull request. A release that isn't signed by your key is never listed, and the game refuses it too.
| Shown | Comes from |
|---|---|
| Name | The README's title, else the repository's name |
| Author, stars | The repository |
| Version, size | The latest release and its asset |
| Description | The README's text between its title and its next heading |
| Preview | The README's first video, GIF or image hosted on GitHub: a file of the repository, or one dropped into the README on github.com. A video or a GIF plays as a short muted clip |
A mod's page shows its README under its preview, name and buttons. The game draws:
| Headings | Three sizes, a line under the two biggest. The title isn't repeated, it's the mod's name |
| Text | Bold, italic, code and links. A link opens the browser, one to phigrospp://install/ asks to install that mod |
| Lists, quotes, code blocks, rules | As they read |
| Tables | A line per row: its first cell in bold, then the others |
| Images, GIFs, videos | Up to 8, PNG, JPEG, WebP, GIF, MP4, MOV or WebM hosted on GitHub. The first two videos or GIFs play, the others show their first frame. The one that is the preview isn't shown twice |
Other HTML is dropped and its text kept. The README is read up to 12000 characters.
A Settings button opens the tab your mod put its settings in, when it has any.
phigrospp://install/<owner>/<repo> opens the game on the mod, from a README or a web page.
"Install from GitHub" in the Mods tab installs the repository whose link is in the clipboard, and so does a
phigrospp://install/ link. The player is warned that nobody reviewed the mod. Its release doesn't have to be
signed, but once a signed one was installed, the next ones must be signed by the same key.