# Publish and release (/docs/products/dash-dots/developers/publish-and-release)

Build to check your dot, register it once, then publish, test and release each version. Run each command from the dot's folder.

## Build

`monime dot publish` builds for you. Build on your own to catch mistakes early:

```bash
monime dot build
```

If something's wrong, the build tells you where, down to the line. Errors stop the build. Warnings don't, but they're worth fixing. A `<For>` list without a `key` is one.

The build also refuses [a server on your computer or network](/docs/products/dash-dots/developers/network-and-files#a-server-on-your-computer) in `network.hosts`.

To try the finished build, [preview it](/docs/products/dash-dots/developers/run-on-a-phone#preview-the-release-build).

### Number your releases

Raise `version` in `dot.json` every time you publish:

- `1.2.0` to `1.2.1` for a fix
- `1.2.0` to `1.3.0` for something new
- `1.3.0` to `2.0.0` for a big change, like removing a feature or redesigning the dot

## Register the dot

A dot belongs to a Space, the business that offers it. When you publish or release, you act for that Space. Pick it with `monime space use` or pass `--space ID`. See [Log in and choose a Space](/docs/developer-resources/cli/login-and-spaces).

```bash
monime dot register
```

This creates the dot in your Space and saves its ID in `dot.json`. Commit that, and your team publishes to the same dot. The dot's [`package`](/docs/products/dash-dots/reference/dot-json), a reverse domain name such as `sl.yourcompany.meter`, can belong to only one Space. From then on, any developer in the Space can publish the dot.

## Publish a version

[Raise `version`](#number-your-releases), then:

```bash
monime dot publish
```

The CLI builds the dot and uploads it as a new version. If it's interrupted, run it again.

The first time, it asks for the listing customers see in Dash: a subtitle of up to 64 characters and a description of up to 3,000. You can pass `--subtitle` and `--description` instead. A new subtitle shows once a reviewer approves it.

### Checks and review

Monime checks every version, and some go to a reviewer too. Add `--wait` to watch. The command then fails if the version is rejected:

```bash
monime dot publish --wait
```

`monime dot version list` shows where each version stands:

| State           | Meaning                                        |
| --------------- | ---------------------------------------------- |
| `checking`      | Monime is checking it                          |
| `in_review`     | A reviewer is looking at it                    |
| `rejected`      | It failed a check or review. The note says why |
| `ready_to_test` | Testers get it                                 |
| `released`      | Everyone gets it                               |
| `superseded`    | A newer version replaced it                    |
| `switched_off`  | Dash won't open it                             |

### When publishing fails

The error says why. Usually it's one of these:

- The version isn't higher than your last one, or that number's taken. Raise `version`.
- Another Space has this `package`. Use a domain you own.
- The `package` or `name` doesn't match the registered dot. Change it back.
- There's no subtitle yet. Pass `--subtitle`.

## Test with testers

Testers get each new version once it reaches `ready_to_test`. Everyone else keeps the released one. Add anyone as a tester by their DashTag, the name they use in Dash.

```bash
monime dot tester add @aminata_k
```

`monime dot tester list` shows your testers, and `monime dot tester remove @aminata_k` takes one off.

To give testers an older version, run `monime dot release 1.2.0 --to testers`.

## Release to everyone

```bash
monime dot release
```

Everyone gets the version your testers have now. To pick one, name it: `monime dot release 1.3.0`. You can only release a version that testers have already had.

To roll back, release an earlier version with `monime dot release 1.2.0`.

## Switch a dot off

If something goes badly wrong, switch it off. Within a minute, Dash stops opening it and refuses payments through it. Add a `--note` for your Space's records, and switch it back on once it's fixed:

```bash
monime dot switch-off 1.3.0 --note "Payments fail on 1.3.0"
monime dot switch-on 1.3.0
```

Leave out `1.3.0` to switch the whole dot off or on.

## See your dots

`monime dot list` shows the Space's dots and which version testers and everyone get. `monime dot describe` shows this dot's listing and whether it's switched off. Outside the dot's folder, name it with `--dot ID`.

If a command fails and you're not sure why, `monime dot doctor` checks your setup and tells you what to fix.

## Keep the Dot packages up to date

Update `@monimesl/dot-runtime` and `@monimesl/dot-cli` together, to the same version. [What changed in Dot](/docs/products/dash-dots/reference/changelog) lists what each release changes.

## Publish from CI

In CI, the CLI can't ask questions. Set an access token and pass every flag. On a first publish without `--description`, the subtitle becomes the description.

```bash
export MONIME_ACCESS_TOKEN="mon_..."   # from your CI secrets
monime dot publish --space "$MONIME_SPACE_ID" \
  --subtitle "Top up your meter in seconds" \
  --description "Buy meter credit and get your token in Dash." \
  --wait
```

See [CI and scripts](/docs/developer-resources/cli/ci-and-scripts) for tokens and exit codes.
