@tryghost/pro-ship
v1.1.5
Published
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.
Maintainers
Keywords
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
pnpm add --save-dev @tryghost/pro-ship
# or
npm install --save-dev @tryghost/pro-shipWhat it does
Run from a clean working tree, pro-ship performs a release end to end:
- Verifies the git working tree is clean (aborts otherwise).
- Bumps the version in
package.json(without letting the package manager create its own commit or tag). - Updates the image tag in
k8s/overlays/production/deployment.ymlwhen that file exists. - Commits the changes (
package.json, the lockfile, and the manifest) asvX.Y.Z. - Creates an annotated
vX.Y.Ztag and pushes with--follow-tags. - If
--publishis set, runs<package-manager> publish.
CI/CD deploys off the pushed tag, so the tag format (vX.Y.Z) is stable.
Choosing the version
Pass a release type or an explicit version as an argument, or run with no argument to choose interactively:
# 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, orprerelease. - An explicit version must be valid semver without build metadata — the
+buildsuffix 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:
- The corepack
packageManagerfield inpackage.json. - The lockfile on disk (
pnpm-lock.yaml,yarn.lock,package-lock.json). - 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):
// 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.
git clonethis repo &cdinto it as usual.- Run
pnpm installto install top-level dependencies.
Test
pnpm --filter @tryghost/pro-ship lintruns lint.pnpm --filter @tryghost/pro-ship testruns lint and tests.
Copyright & License
Copyright (c) 2013-2026 Ghost Foundation - Released under the MIT license.
