# Releasing

> How GUIJam releases are cut. Pre-releases on the next tag, platform gjd packages and npm trusted publishing.

Versions come from the release tag. Nothing in the repository needs a version bump.

## Publish a pre-release

Publish a GitHub release tagged `vX.Y.Z-rc.N` and marked as a pre-release. CI then:

1. Runs every check on the tag.
2. Builds `gjd` for macOS (arm64, x64), Linux (x64, arm64) and Windows (x64).
3. Publishes it as `@guijam/gjd-<os>-<arch>` packages, which `guijam` installs as optional dependencies.
4. Publishes `guijam` under the `next` dist-tag.

Packages already on npm are skipped, so a failed release can be run again.

## Try it from npm

```bash
npx guijam@next init
```

Or set up every playground app with the published version and test them:

```bash
GUIJAM_SPEC=guijam@X.Y.Z-rc.N scripts/playground.sh
pnpm test:playground
```

## Publish the release

Publish the release `vX.Y.Z` to move `latest`.

## npm credentials

npm requires two-factor authentication to publish. For CI, either set up npm trusted publishing on each of the six packages (GitHub Actions, workflow `release.yml`, environment `npm`), or store a granular token with "Bypass two-factor authentication" as the `NPM_TOKEN` secret.

The `npm-check` workflow (Actions, then Run workflow) confirms that the token works and belongs to the `guijam` organization, and publishes nothing.
