|
1 | | -## ⚠️ This project is under active development. Use with care. ⚠️ |
| 1 | +# MG-CLI |
2 | 2 |
|
3 | | -# Project Contents |
| 3 | +[](https://www.nuget.org/packages/mg-cli) |
4 | 4 |
|
5 | | -This project is a collection of tools for managing builds and deployments of Unity and Godot projects. It is designed to |
6 | | -be used with Unity and Godot projects that are built for multiple platforms and require automated deployment to |
7 | | -storefronts. |
| 5 | +A .NET command-line tool for managing builds, versioning, and deployments of Godot projects. Handles the full CI/CD pipeline — from building export presets, to deploying on Steam and itch.io, to sending Discord notifications. |
8 | 6 |
|
9 | | -- [Deployment](Deployment/README.md): Deploys artifacts to storefronts (Steam, Itch.io, Google Play Store, Apple Store) |
10 | | -- [DiscordBot](DiscordBot/README.md): Discord bot for starting builds and deployments also for notifications. |
| 7 | +## Installation |
| 8 | + |
| 9 | +```bash |
| 10 | +dotnet tool install --global mg-cli |
| 11 | +``` |
| 12 | + |
| 13 | +## Commands |
| 14 | + |
| 15 | +| Command | Description | |
| 16 | +|---|---| |
| 17 | +| `godot-setup` | Install Godot engine and export templates | |
| 18 | +| `godot-import` | Run the Godot import process | |
| 19 | +| `godot-build` | Build a Godot project for one or more export presets | |
| 20 | +| `godot-versioning` | Bump the version in `project.godot` | |
| 21 | +| `csproj-versioning` | Bump the version in a `.csproj` file | |
| 22 | +| `commit` | Commit and tag the current build | |
| 23 | +| `discord-hook` | Send a Discord webhook with build info and changelog | |
| 24 | +| `steamcmd-setup` | Install SteamCMD from the Steamworks SDK | |
| 25 | +| `steam-deploy` | Deploy a build to Steam | |
| 26 | +| `itchio-setup` | Install Butler (itch.io CLI) | |
| 27 | +| `itchio-deploy` | Deploy a build to itch.io | |
| 28 | +| `test` | Print the MG-CLI banner | |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +### Godot Setup |
| 33 | + |
| 34 | +Install the Godot engine and export templates for a specific version. Supports Windows, Linux, and macOS. |
| 35 | + |
| 36 | +```bash |
| 37 | +mg-cli godot-setup --version <godot-version> |
| 38 | +``` |
| 39 | + |
| 40 | +| Option | Alias | Required | Description | |
| 41 | +|---|---|---|---| |
| 42 | +| `--version` | `-v` | Yes | Godot version to install (e.g. `4.4.1`) | |
| 43 | + |
| 44 | +Downloads the engine and export templates from the official Godot GitHub releases, extracts them to the standard platform location, and sets executable permissions. |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +### Godot Import |
| 49 | + |
| 50 | +Run the Godot headless import process for a project. |
| 51 | + |
| 52 | +```bash |
| 53 | +mg-cli godot-import <project-path> <godot-version> |
| 54 | +``` |
| 55 | + |
| 56 | +| Argument | Required | Description | |
| 57 | +|---|---|---| |
| 58 | +| `project-path` | Yes | Path to the Godot project directory | |
| 59 | +| `godot-version` | Yes | Godot version to use | |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +### Godot Build |
| 64 | + |
| 65 | +Build a Godot project for one or more export presets. Supports both interactive selection and explicit preset names. |
| 66 | + |
| 67 | +```bash |
| 68 | +# Release build |
| 69 | +mg-cli godot-build -p <project-path> -v <godot-version> -r <preset-name> |
| 70 | + |
| 71 | +# Debug build |
| 72 | +mg-cli godot-build -p <project-path> -v <godot-version> -d <preset-name> |
| 73 | + |
| 74 | +# Interactive mode — select presets from a list |
| 75 | +mg-cli godot-build -p <project-path> -v <godot-version> -i |
| 76 | +``` |
| 77 | + |
| 78 | +| Option | Alias | Required | Description | |
| 79 | +|---|---|---|---| |
| 80 | +| `--projectPath` | `-p` | Yes | Path to the Godot project | |
| 81 | +| `--godotVersion` | `-v` | Yes | Godot version | |
| 82 | +| `--export-release` | `-r` | No | Export preset name (release) | |
| 83 | +| `--export-debug` | `-d` | No | Export preset name (debug) | |
| 84 | +| `--interactive` | `-i` | No | Select presets interactively | |
| 85 | + |
| 86 | +Before building, the command runs `dotnet build` to catch C# compilation errors and ensures the `.godot` directory exists (running import if needed). Build logs are written to `builds/Logs/<preset>.log`. On macOS, the resulting `.app` bundle is automatically unsigned and de-quarantined. |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +### Godot Versioning |
| 91 | + |
| 92 | +Bump the version in a Godot `project.godot` file. Uses a `YYYY.MM.BUILD` scheme — year and month are set automatically, and the build number is incremented. |
| 93 | + |
| 94 | +```bash |
| 95 | +mg-cli godot-versioning -p <project-path> |
| 96 | +``` |
| 97 | + |
| 98 | +| Option | Alias | Required | Description | |
| 99 | +|---|---|---|---| |
| 100 | +| `--projectPath` | `-p` | Yes | Path to the Godot project directory | |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +### Csproj Versioning |
| 105 | + |
| 106 | +Bump the patch version in a `.csproj` file. Increments the third segment of a `MAJOR.MINOR.PATCH` version string. |
| 107 | + |
| 108 | +```bash |
| 109 | +mg-cli csproj-versioning <path-to-csproj> [property-name] |
| 110 | +``` |
| 111 | + |
| 112 | +| Argument | Required | Default | Description | |
| 113 | +|---|---|---|---| |
| 114 | +| `path` | Yes | — | Path to the `.csproj` file | |
| 115 | +| `propertyName` | No | `AssemblyVersion` | The XML element to update | |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +### Commit |
| 120 | + |
| 121 | +Stage all changes, commit with the current build version, create a git tag, and push to `origin/main`. |
| 122 | + |
| 123 | +```bash |
| 124 | +mg-cli commit -p <project-path> |
| 125 | +``` |
| 126 | + |
| 127 | +| Option | Alias | Required | Description | |
| 128 | +|---|---|---|---| |
| 129 | +| `--projectPath` | `-p` | Yes | Path to the Godot project | |
| 130 | + |
| 131 | +Commit message format: `_Build Version: <version>` |
| 132 | +Tag format: `v<version>` |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +### Discord Hook |
| 137 | + |
| 138 | +Send a Discord webhook embed with the latest build version and a changelog generated from git commits since the previous tag. |
| 139 | + |
| 140 | +```bash |
| 141 | +mg-cli discord-hook -p <project-path> -h <webhook-url> -s <steam-url> -l <logo-url> |
| 142 | +``` |
| 143 | + |
| 144 | +| Option | Alias | Required | Description | |
| 145 | +|---|---|---|---| |
| 146 | +| `--projectPath` | `-p` | Yes | Path to the Godot project | |
| 147 | +| `--hookUrl` | `-h` | Yes | Discord webhook URL | |
| 148 | +| `--steamUrl` | `-s` | Yes | Steam store page URL | |
| 149 | +| `--logoUrl` | `-l` | Yes | URL to a logo/thumbnail image | |
| 150 | +| `--noChangeLog` | — | No | Skip the changelog in the embed | |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +### SteamCMD Setup |
| 155 | + |
| 156 | +Download and install SteamCMD from the Steamworks SDK. |
| 157 | + |
| 158 | +```bash |
| 159 | +mg-cli steamcmd-setup |
| 160 | +``` |
| 161 | + |
| 162 | +Installs the content builder to `~/steamcmd`. No arguments required. |
| 163 | + |
| 164 | +--- |
| 165 | + |
| 166 | +### Steam Deploy |
| 167 | + |
| 168 | +Deploy a build to Steam using SteamCMD and a VDF build configuration file. |
| 169 | + |
| 170 | +```bash |
| 171 | +mg-cli steam-deploy -p <project-path> --vdf <path-to-vdf> -u <username> -pw <password> |
| 172 | +``` |
| 173 | + |
| 174 | +| Option | Alias | Required | Description | |
| 175 | +|---|---|---|---| |
| 176 | +| `--projectPath` | `-p` | Yes | Path to the Godot project | |
| 177 | +| `--vdf` | — | Yes | Path to the `.vdf` build config | |
| 178 | +| `--username` | `-u` | Yes | Steamworks username | |
| 179 | +| `--password` | `-pw` | Yes | Steamworks password | |
| 180 | +| `--preview` | `-pv` | No | Mark the build as a preview | |
| 181 | + |
| 182 | +The VDF file's `Desc` field is automatically set to the current version. |
| 183 | + |
| 184 | +--- |
| 185 | + |
| 186 | +### Itch.io Butler Setup |
| 187 | + |
| 188 | +Download and install [Butler](https://itch.io/docs/butler/), the itch.io command-line deployment tool. |
| 189 | + |
| 190 | +```bash |
| 191 | +# Install Butler |
| 192 | +mg-cli itchio-setup |
| 193 | + |
| 194 | +# Check installed version |
| 195 | +mg-cli itchio-setup -v |
| 196 | +``` |
| 197 | + |
| 198 | +| Option | Alias | Required | Description | |
| 199 | +|---|---|---|---| |
| 200 | +| `--version` | `-v` | No | Print the installed Butler version instead of installing | |
| 201 | + |
| 202 | +After installation you will be prompted to log in interactively. |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +### Itch.io Deploy |
| 207 | + |
| 208 | +Push a build to itch.io using Butler. |
| 209 | + |
| 210 | +```bash |
| 211 | +mg-cli itchio-deploy <build-path> <company/game:platform> -p <project-path> |
| 212 | +``` |
| 213 | + |
| 214 | +| Argument | Required | Description | |
| 215 | +|---|---|---| |
| 216 | +| `build-path` | Yes | Path to the build directory | |
| 217 | +| `company/game:platform` | Yes | itch.io target (e.g. `my-studio/my-game:windows`) | |
| 218 | + |
| 219 | +| Option | Alias | Required | Description | |
| 220 | +|---|---|---|---| |
| 221 | +| `--projectPath` | `-p` | Yes | Path to the Godot project | |
| 222 | + |
| 223 | +--- |
| 224 | + |
| 225 | +## CI/CD |
| 226 | + |
| 227 | +The repository includes a [GitHub Actions workflow](.github/workflows/publish.yml) that runs on every push to `main`: |
| 228 | + |
| 229 | +1. Bumps the package version |
| 230 | +2. Commits the version change and creates a git tag |
| 231 | +3. Builds, packs, and publishes to NuGet |
| 232 | + |
| 233 | +To set up publishing, add a `NUGET_API_KEY` secret to your repository (Settings → Secrets and variables → Actions). |
| 234 | + |
| 235 | +## License |
| 236 | + |
| 237 | +[MIT](LICENSE.md) |
0 commit comments