# @tryghost/pro-ship

> Ship a Ghost(Pro) package: bump the version, update the production Kubernetes deployment image tag when one exists, commit, tag, push — and optionally publish to the registry.

Latest version **1.1.9** (published 2026-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tryghost/pro-ship
pnpm add @tryghost/pro-ship
yarn add @tryghost/pro-ship
bun add @tryghost/pro-ship
```

Provides the command `pro-ship`.

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.9 |
| Published | 2026-09-15 |
| First published | 2023-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=20.20.0 |
| Dependencies | 2 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ghost Foundation |
| Maintainers | zimoatghost, allouis, kernalghost, chrisraible, erisds, johnonolan, kevinansfield, cobbspur, aileencgn, jloh, minimaluminium, sam-lord, pauladamdavis, bobvaneck, joeegrigg, hadret, erik-ghost, sagzy, vershwal, zach1618, mike182uk, luissazevedo, lsinger, nickmoreton, renatoworks, rblstr-ghost, evanhahn-ghost, austin.burdine, weylandswart, ghost-slimer, tmciesco, jonatan-ghost, 9larsons |

## Links

- npm: https://www.npmjs.com/package/@tryghost/pro-ship
- Repository: https://github.com/TryGhost/Pro-Packages
- Homepage: https://github.com/TryGhost/Pro-Packages#readme
- Issues: https://github.com/TryGhost/Pro-Packages/issues
- npm.io page: https://npm.io/package/@tryghost/pro-ship

## Dependencies (2)

- [semver](https://npm.io/package/semver.md) 7.8.5
- [@tryghost/root-utils](https://npm.io/package/@tryghost/root-utils.md) 2.3.14

## Recent versions

- 1.1.9 (latest) — 2026-09-15
- 1.1.8 — 2026-08-19
- 1.1.7 — 2026-07-16
- 1.1.6 — 2026-07-16
- 1.1.5 — 2026-07-06
- 1.1.4 — 2026-06-25
- 1.1.3 — 2026-06-25
- 1.1.2 — 2026-06-25
- 1.1.1 — 2026-06-24
- 1.1.0 — 2026-06-24
- 1.0.10 — 2026-05-14
- 1.0.9 — 2026-05-14
- 1.0.8 — 2026-04-01
- 1.0.7 — 2025-04-09
- 1.0.6 — 2023-09-12
- … 6 more at https://npm.io/package/@tryghost/pro-ship/versions

## README

# Pro Ship

Ship a Ghost(Pro) package: bump the version, update the production Kubernetes
deployment image tag when one exists, commit, tag, push — and optionally publish
to the registry.

## Install

```sh
pnpm add --save-dev @tryghost/pro-ship
# or
npm install --save-dev @tryghost/pro-ship
```

## What it does

Run from a clean working tree on the default branch (i.e. `main`), `pro-ship`
performs a release end to end:

1. Verifies the git working tree is clean (aborts otherwise).
2. Verifies you are on the repo's default branch (aborts otherwise).
3. Bumps the version in `package.json` (without letting the package manager
   create its own commit or tag).
4. Updates the image tag in `k8s/overlays/production/deployment.yml` when that
   file exists.
5. Commits the changes (`package.json`, the lockfile, and the manifest) as
   `vX.Y.Z`.
6. Creates an annotated `vX.Y.Z` tag and pushes with `--follow-tags`.
7. If `--publish` is set, runs `<package-manager> publish`.

CI/CD deploys off the pushed tag, so the tag format (`vX.Y.Z`) is stable.

The default branch is resolved from `origin/HEAD` rather than assumed to be
`main` or `master`, so `main`/`master` naming is handled automatically. `git
clone` sets `origin/HEAD` for you; in the rare case it is missing, the release
aborts with guidance to run `git remote set-head origin --auto`.

## Choosing the version

Pass a release type or an explicit version as an argument, or run with no
argument to choose interactively:

```sh
# Interactive picker (patch / minor / major / custom), previews each result
pnpm exec pro-ship

# Release type
pnpm exec pro-ship minor

# Explicit version
pnpm exec pro-ship 1.2.3
```

- A release type is one of `major`, `minor`, `patch`, `premajor`, `preminor`,
  `prepatch`, or `prerelease`.
- An explicit version must be valid semver **without build metadata** — the
  `+build` suffix is rejected because it cannot appear in a deployment image
  tag. Prerelease tags (`1.2.3-beta.1`) are fine.
- The interactive picker requires a TTY. In non-interactive contexts (such as
  CI) pass the release type or version as an argument; otherwise the run fails
  with usage guidance.

## Package manager support

The version bump (and publish) run with the repository's own package manager —
**pnpm**, **npm**, or **Yarn Classic (1.x)** — resolved in this order:

1. The corepack `packageManager` field in `package.json`.
2. The lockfile on disk (`pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`).
3. Defaulting to yarn for legacy consumers with no detectable signal.

A `packageManager` field naming an unsupported manager — including **Yarn
Berry** (`yarn@>=2`), whose `yarn version` lacks the flags this tool relies on —
fails fast rather than guessing.

## Publishing

Publishing is **opt-in** via `--publish`. When set, `pro-ship` runs
`<package-manager> publish` after the release commit and tag are pushed.

npm refuses to publish a package whose `package.json` sets `"private": true`, so
`pro-ship` enforces the same rule up front: passing `--publish` for such a
package fails before any git mutation. This is the npm `private` **field**, not
repository visibility — a package in a private GitHub repository still publishes
to npm as long as it isn't marked `"private": true`. (Pro-Packages itself is a
private repo whose `@tryghost/*` packages publish publicly; only the monorepo
root sets `"private": true`, to keep the workspace root off the registry.)

Whether a repo publishes is a property of the repo, not of each release, so wire
the flag into the package's own `ship` script rather than typing it each time
(typing it on the command line also trips the `pnpm`/`npm` `run` `--`
separator):

```jsonc
// publishable library
{ "scripts": { "ship": "pro-ship --publish" } }

// deploy-by-tag service (no publish)
{ "scripts": { "ship": "pro-ship" } }
```

With that in place, a release is just `pnpm ship` (interactive) or
`pnpm ship minor` (non-interactive).

## Develop

This is a monorepo package. Follow the instructions for the top-level repo.

1. `git clone` this repo & `cd` into it as usual.
2. Run `pnpm install` to install top-level dependencies.

## Test

- `pnpm --filter @tryghost/pro-ship lint` runs lint.
- `pnpm --filter @tryghost/pro-ship test` runs lint and tests.

# Copyright & License

Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).

---
_Source: https://npm.io/package/@tryghost/pro-ship · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
