# Releases and versions

> A release is a vMAJOR.MINOR.PATCH tag that rmp deploy checks and pushes; the version name and the Android version code come from it, and CI turns it into a GitHub release.

Source: https://omardev29.github.io/rmp-docs/publishing/releases.html

A release is an annotated git tag named `vMAJOR.MINOR.PATCH`. `rmp deploy` makes it after checking everything CI would check, pushes it, and CI builds every enabled target from that commit and publishes them as one GitHub release. The tag is also the only place the version lives: the version Android and iOS show, the Android version code and the name of the release are all read from it.

## A release is a tag

```shell
rmp deploy 1.2.0
```

That tags the commit you are on as `v1.2.0` — the `v` is added when you leave it out — and pushes the tag to `origin`. Nothing else is pushed: the commit has to be on GitHub already, which is one of the things `rmp deploy` checks before it tags anything. On success it prints:

```text
== checking v1.2.0 the way CI will ==
  ok    v1.2.0 is release-ready
 * [new tag]         v1.2.0 -> v1.2.0

pushed v1.2.0. CI builds every target and attaches them to the release.
  gh run watch

to undo, if you were quick enough:
  git push --delete origin v1.2.0 && git tag -d v1.2.0
```

The tag is annotated, with the message `Release v1.2.0`: a real git object with an author and a date, which is what `git describe` and most release tooling expect. A lightweight tag pushed by hand builds just the same; `rmp deploy` makes the annotated kind.

## The version comes from the tag

There is deliberately no `version` key in `raylib_multiplatform.toml`. The build reads the tag CI is building, and everything that carries a version gets it from there:

| Tag | Version name | Android version code | GitHub release |
|---|---|---|---|
| `v1.2.3` | `1.2.3` | `1002003` | a release |
| `v1.2.3-rc1` | `1.2.3-rc1` | `1002003` | marked as a pre-release |
| `v1.2.3+7` | `1.2.3+7` | `1002003` | a release |
| `v0.9.0` | `0.9.0` | `9000` | a release |
| `v1.2` | refused: not `vMAJOR.MINOR.PATCH` |  |  |
| `v01.2.3` | refused: a leading zero, which would share the code of `v1.2.3` |  |  |
| `v0.0.0` | refused: its code would be 0, and Android's is positive; the first release is `v0.0.1` |  |  |
| no tag | `0.0.0-dev` | `1` | none |

The version name is the Android `versionName`, the iOS `MARKETING_VERSION`, and the version itch.io shows for the upload (there it keeps its `v`: `v1.2.3`). Every build that is not a tag build, on your machine or on a push, is `0.0.0-dev` with version code `1`.

The tag has to be `v`, three numbers separated by dots, and optionally a `-` or `+` suffix of letters, digits, dots and hyphens. Anything else that starts with `v` is refused — there is no fallback, because a release named `0.0.0-dev` would be worse than no release:

```text
configure: error: tag 'v1.2' is not vMAJOR.MINOR.PATCH (optionally -rc1 / +build).
                  Releases take their version from the tag and there is no fallback that would not be a lie.
                  Delete the tag and re-tag: git tag -d v1.2 && git push origin :refs/tags/v1.2
```

### Pre-releases

A hyphen in the tag marks the GitHub release as a pre-release: `v1.2.0-rc1`, `v1.2.0-beta.2`. It is built and published like any other tag, and it is labelled so nobody watching the repository mistakes a candidate for the real thing.

```shell
rmp deploy 1.2.0-rc1
```

A `+` suffix is build metadata, not a pre-release: `v1.2.0+7` is published as a normal release.

## The Android version code

Google Play orders the builds of an app by an integer, the version code, and refuses an upload whose code is not higher than the last one it accepted. The framework packs the three numbers of the tag into that integer so that it rises whenever the version does:

```text
versionCode = MAJOR * 1000000 + MINOR * 1000 + PATCH
```

That only works while `MINOR` and `PATCH` fit in three digits, so a tag with either of them at 1000 or above is refused: `minor and patch must each stay below 1000 so the Android versionCode stays monotonic`. And Play refuses any code above 2100000000, so `MAJOR` stops at 2099: `major must stay at or below …`. The highest version that fits is `v2099.999.999`, code `2099999999`.

Two things the arithmetic does not do for you:

- **Nothing compares a tag with the previous one.** The code rises only if your tags do. Tag `v1.0.0` after `v2.0.0` and the build gets a lower code than the one Play already has, and Play refuses it.
- **A pre-release shares its version's code.** `v1.2.3-rc1` and `v1.2.3` are both `1002003`. Nothing uploads to Play automatically, so this costs nothing until you hand Play both: upload one of them, never the two.

## What rmp deploy checks

Each check catches a mistake that would otherwise surface on CI, and finding it twenty minutes into a run, on a tag that is already public, is the expensive way. They run in this order, and the first that fails stops `rmp deploy` before it tags anything:

1. **Nothing uncommitted.** CI builds the commit, so a change that is only in your working tree would not be in the release. Staged or not, a change to a tracked file stops it (files git does not track are not part of any commit, and do not count): `FAIL: uncommitted changes. Commit or stash them first.`
2. **The tag is new here.** `FAIL: the tag v1.2.0 already exists here.`
3. **The tag is new on `origin`.** A version that has been pushed once is not cut again: `FAIL: v1.2.0 is already on the remote. Releases are not re-cut; bump the
version.` When `origin` cannot be asked at all — no remote, no network — that stops it too, with what git said.
4. **Your branch is on `origin`.** CI checks the tag out from GitHub, so a tag on a commit that exists only on your machine builds nothing: `FAIL: origin/main does not exist. Push the branch first:`, followed by `rmp push`. The first `rmp push` of a branch with no upstream is `git push -u origin
<branch>`, which pushes it and ties it to `origin`; with no remote at all, it stops and says how to add one.
5. **The commit is the one `origin` has.** `HEAD` must be exactly what `origin/<branch>` points at, as of your last fetch: `FAIL: HEAD is not what origin/main points at (as of your last fetch).` It suggests `rmp push`, which pushes unless `gh` reports a CI run in flight.
6. **The configuration, the way CI will read it.** `tools/configure.py` runs with the tag set the way CI sets it, so the whole `.toml` is validated, the tag is parsed into a version name and code, and — in a game, not in the framework's own repository — the ids are checked for placeholders. That last check is what stops a first release from going out under `com.example.`:
   ```text
   == checking v1.2.0 the way CI will ==

     configure: error: refusing to build a release with placeholder identifiers:
                         [android] application_id is still the example value 'com.example.my_game'
                         [ios] bundle_id is still the example value 'com.example.my-game'

                       A Google Play application id is PERMANENT: once published you can never change it.
                       Set real values in raylib_multiplatform.toml before tagging.
   ```
   An id is checked only when its platform is a target: with `ios` switched off in `[targets]`, the iOS bundle id is not looked at.
7. **Tag and push.** `git tag -a v1.2.0 -m "Release v1.2.0"`, then `git push origin v1.2.0`.

Every refusal exits with status 1, and leaves no tag behind.

### A tag pushed by hand

Tagging with git directly skips the checks on your machine, not the ones on CI. In a game, the first job of a tag run validates the configuration with the same placeholder check, and stops the run if it fails. A tag that is not `vMAJOR.MINOR.PATCH` fails every job that builds, at the step that generates its build files. Either way nothing is published, and the tag is left on GitHub to be deleted — see [Undoing a tag](https://omardev29.github.io/rmp-docs/publishing/releases.html#undoing-a-tag).

Only tags that start with `v` start a release run at all.

## What CI does with a tag

A tag runs the full matrix: every target `[targets]` enables, each built, checked and, where CI can, booted ([Continuous integration](https://omardev29.github.io/rmp-docs/publishing/ci.html) says what each one gets). A push to the branch while a tag run is going does not cancel it: superseded branch runs are cancelled, tag runs never are.

Then a `release` job collects what every target uploaded and publishes it. It runs only when:

- the `lint` job passed — in a game, that is the workflows, the configuration, the pinned versions, the licences and a frame drawn in software;
- and no platform job failed or was cancelled. A platform you switched off in `[targets]` is skipped, and a skipped one does not hold the release back — otherwise turning a platform off would turn releases off with it.

In the framework's own repository the release also waits for the jobs only it has: its examples, the game it makes with `rmp new`, and this documentation, checked against the commit being released.

When the release is published, the [itch.io](https://omardev29.github.io/rmp-docs/publishing/itch.html) job pushes the builds to itch.io, if it is configured. Firebase Test Lab, if configured, runs alongside and does not hold the release back.

## What the release holds

The release is named after the tag, its notes are generated by GitHub from what changed since the previous one, and these are its files. A target your game does not build has no file:

| File | What it is |
|---|---|
| `linux-x64-glibc-build.zip`  `linux-arm64-glibc-build.zip`  `linux-riscv64-glibc-build.zip`  `linux-x64-musl-build.zip`  `linux-x64-glibc-drm-build.zip`  `linux-arm64-glibc-drm-build.zip` | Linux: the executable, its assets and `LICENSES.txt`. [Desktop and BSD archives](https://omardev29.github.io/rmp-docs/publishing/desktop.html#linux) |
| `windows-x64-build.zip`  `windows-arm64-build.zip` | Windows: the `.exe`, its assets and `LICENSES.txt`. |
| `macos-build.zip` | macOS: one universal executable for Apple silicon and Intel, its assets and `LICENSES.txt`. |
| `bsd-freebsd-x86-64-build.zip`  `bsd-freebsd-arm64-build.zip`  `bsd-openbsd-x86-64-build.zip`  `bsd-openbsd-arm64-build.zip`  `bsd-netbsd-x86-64-build.zip` | FreeBSD, OpenBSD and NetBSD, built in their own virtual machines. |
| `web-build.zip` | The browser build. [The web build](https://omardev29.github.io/rmp-docs/publishing/web.html) |
| the debug `.apk` | The Android debug build: installable on a phone, not what Play takes. It shows Google's test ads, whatever ids the .toml carries. |
| the release `.aab` | The App Bundle signed with your upload key. Only there when the Android signing secrets are set. [Google Play](https://omardev29.github.io/rmp-docs/publishing/google-play.html) |
| `ios-raylib-xcframework.zip` | The iOS engine, `raylib.xcframework`, for device and simulator. |
| `ios-app-simulator.zip` | The game built for the iOS simulator: unsigned, and not installable on a device. [The App Store](https://omardev29.github.io/rmp-docs/publishing/app-store.html) |
| `THIRD_PARTY_LICENSES.md` | Every vendored component, its licence, and whether the copy is modified. |
| `SHA256SUMS` | The SHA-256 of every zip, APK and AAB above. |

One file never reaches a release: the App Bundle CI signs with a throwaway key when your signing secrets are not set. It is uploaded to the run under its own artifact name, `android-unsigned-aab`, with `-NOT-FOR-PLAY` in its file name. The release job downloads every artifact of the run, that one included, and then leaves it out by name: it is not in `SHA256SUMS` and not in the list of files the release attaches — so a bundle Play would accept is the only kind a release can carry.

### Checking a download

`SHA256SUMS` lists every archive by its file name, as the release has it. With the files downloaded next to it:

```shell
sha256sum -c SHA256SUMS                    # every file it lists
sha256sum -c --ignore-missing SHA256SUMS   # only the ones you downloaded
```

### The licence notices

Every desktop and BSD archive carries `LICENSES.txt` beside the executable, `web-build.zip` beside the page, the APK and the App Bundle among their assets, and the iOS app in its bundle. Each is generated from the components block of `THIRD_PARTY_LICENSES.md` for what that build contains: the full notice of every component in it, with a line saying which copies are modified. So the web's notice names none of the desktop-only pieces — GLFW, RGFW, glad, the Windows shims — that a `.wasm` does not contain, and only the Android one credits raymob. It is the only third-party notice the game ships, so turning it off needs a reason on record — where the credits are instead:

raylib_multiplatform.toml

```toml
[deploy]
licenses = false
```

```text
  raylib_multiplatform.toml:2: licenses = false
                               ^^^^^^^^^^^^^^^^

  configure: error: [deploy] licenses = false removes LICENSES.txt from every package, and it is the only third-party notice the game ships.
                    Say where the credits are instead: credits_note = "the Credits scene, from the main menu". If there is no such scene, leave licenses = true.
```

raylib_multiplatform.toml

```toml
[deploy]
licenses = false
credits_note = "the Credits scene, from the main menu"
```

## Undoing a tag

**Before CI has published anything** — the run is still going, or it failed — the tag can simply go, from GitHub and from your machine. It is what `rmp deploy` prints when it pushes:

```shell
git push --delete origin v1.2.0 && git tag -d v1.2.0
```

Deleting the tag does not stop a run that has already started, so cancel the run as well, from its page or with `gh run cancel`.

**After the release is published**, deleting the tag leaves the release where it is. Delete both at once:

```shell
gh release delete v1.2.0 --cleanup-tag
```

Then cut the next version rather than the same one again. `rmp deploy` refuses a version that is still on `origin`, and anything you already uploaded to Google Play has spent its version code for good.

**A tag run that went red for a reason that was not yours** — a BSD package mirror having a bad day is the usual one — does not need a new tag. Re-run the failed jobs of that run; the release job, which was skipped, is evaluated again with them:

```shell
gh run rerun <run-id> --failed
```
