Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,11 @@ jobs:
echo "@withmarfa/docs-kit@${VERSION} is already on npm, so there is nothing to publish."
exit 0
fi
case "${VERSION}" in *-*) tag=alpha ;; *) tag=latest ;; esac
# A prerelease takes `latest` while npm has no stable version, so
# `latest` never points at an older prerelease.
current="$(npm view @withmarfa/docs-kit dist-tags.latest 2>/dev/null || true)"
case "${VERSION}" in
*-*) case "${current}" in ''|*-*) tag=latest ;; *) tag=alpha ;; esac ;;
*) tag=latest ;;
esac
npm publish "${RUNNER_TEMP}/pack/${TARBALL}" --access public --tag "${tag}"
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pnpm pack:check # packs the package and reads the tarball

## Release

Push a tag `v<version>` that matches `package.json`. The release workflow builds and tests the package, attaches its tarball to a GitHub release and publishes it to npm through trusted publishing (environment `npm`; no token). A prerelease goes out under the `alpha` tag. A rerun of the publish job skips a version npm already has. Use the smallest version increment that describes compatibility; a version with a hyphen is a prerelease.
Push a tag `v<version>` that matches `package.json`. The release workflow builds and tests the package, attaches its tarball to a GitHub release and publishes it to npm through trusted publishing (environment `npm`; no token). A prerelease goes out under the `latest` tag while npm has no stable version, and under `alpha` after that, so `latest` never names an older prerelease. A rerun of the publish job skips a version npm already has. Use the smallest version increment that describes compatibility; a version with a hyphen is a prerelease.

## Code Review Rules

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ optional peer dependency: install it only if your site reports analytics.

## Install

The kit is published as prereleases under the `alpha` tag:
The kit is published as prereleases. Until it has a stable version, each one is
also the `latest` version:

```sh
pnpm add @withmarfa/docs-kit@alpha
pnpm add -E @withmarfa/docs-kit
```

If your site uses pnpm's `minimumReleaseAge`, add `@withmarfa/*` to
Expand Down Expand Up @@ -567,8 +568,8 @@ Two sites build on the kit, so a breaking change needs a version bump and both
sites updated. Pushing a tag `v<version>` that matches `package.json` runs the release
workflow. It builds and tests the package, creates a GitHub release with the
tarball and publishes that tarball to npm through trusted publishing, with
provenance. A version with a hyphen is a prerelease and is published under the
`alpha` tag.
provenance. A version with a hyphen is a prerelease. It is published under the `latest`
tag while npm has no stable version, and under the `alpha` tag after that.

## License

Expand Down
Loading