Releasing packages

From awesome-reveal/awesome-reveal · View interactive version

Releasing packages is an AI agent skill from the GitHub repository awesome-reveal/awesome-reveal. Releases the awesome-reveal packages with release-please and npm trusted publishing. Use when you merge a release PR, fix a failed publish, set a version, publish a new package for the first time, do a release-please dry run, or leave prerelease mode for a stable release.

How to use this skill

Skill file

Release the packages

A push to main runs .github/workflows/release.yml. The release-please job opens or updates the release PR, "chore: release <branch>". When the release PR merges, the job creates the tags and the GitHub releases, and the publish job publishes to npm with OIDC. The publish job gives each released package the latest dist-tag. A prerelease gets next instead when the package already has a stable version on latest. So a package with no stable version gets its prereleases on latest, and a plain install gets them.

Do not run npm publish, npm trust or npm dist-tag yourself. The agent shell cannot do the npm web 2FA, so these commands fail with EOTP. Give the command to the user, with --otp=<code>, to run as ! <command>.

Merge a release PR

  1. Read the PR diff. Check the versions in .release-please-manifest.json and the new CHANGELOG.md entries.
  2. Make sure that each public package exists on npm: npm view <package> version. List the public packages with pnpm -r ls --json --depth -1 | jq -r '.[] | select(.private | not) | .name'. The publish job has no npm token, so a package that it released before has a trusted publisher. A package with no version or with 0.0.0-placeholder is new. Do "Publish a new package" for it first: one missing publisher fails the job.
  3. Wait for the CI checks of the PR, then squash-merge it: gh pr checks <number> --watch --fail-fast >/dev/null && gh pr merge <number> --squash --delete-branch. The watch prints the full table at each refresh, and its exit status is enough. CI runs on the PR when the secret RELEASE_PLEASE_TOKEN is set. With GITHUB_TOKEN alone, the PR has no CI runs.
  4. Watch the run in the background: gh run watch <run-id> --exit-status. The publish job waits until npm shows each version, and this can take 20 minutes. Find the ID with gh run list --workflow release.yml --branch <branch> --limit 1.
  5. Check the dist-tags: npm view <package> dist-tags --prefer-online. A green run already proves that npm shows each version.

If the publish job fails because of an external cause, such as the trusted publisher, the environment or an npm outage:

  1. Fix the cause.
  2. Run gh run rerun <run-id> --failed within 30 days. pnpm skips the versions that are already on npm.

Do not use "Re-run all jobs". release-please then finds no pending release PR and skips publish. A re-run uses the workflow file and the code of the release commit. If the fix needs a code change, merge the fix and release a new version.

Control the version

```sh

gh pr merge <number> --squash --delete-branch --subject "<PR title> (#<number>)" --body "Release-As: 5.0.0"

```

Do a dry run

Push the branch first. The dry run reads the config and the commits from GitHub, not from the local checkout.

pnpm dlx release-please@17 release-pr --dry-run --token "$(gh auth token)" \
  --repo-url awesome-reveal/awesome-reveal --target-branch <branch>

Check the versions, the changelog entries, and that the workspace: ranges stay unchanged. The action can bundle an older 17.x release than @17, so the result can differ a little.

Publish a new package

npm can add a trusted publisher only to a package that exists.

  1. Make a placeholder in the scratchpad: this package.json, and a short README.

```json

{

"name": "@awesome-reveal/<framework>",

"version": "0.0.0-placeholder",

"license": "MIT",

"repository": {

"type": "git",

"url": "git+https://github.com/awesome-reveal/awesome-reveal.git",

"directory": "packages/<framework>"

},

"publishConfig": { "access": "public" }

}

```

  1. Ask the user to publish it: npm publish --tag placeholder --otp=<code> in that directory. npm refuses a prerelease without --tag. Use a prerelease placeholder: a stable placeholder keeps latest, so pnpm add <package> installs the empty placeholder.
  2. Just before you merge the release PR, ask the user to add the trusted publisher. This needs npm 11.15 or later:

```sh

npm trust github <package> --file release.yml --repo awesome-reveal/awesome-reveal \

--env npm --allow-publish --yes --otp=<code>

```

  1. Merge the release PR within 48 hours. A new trusted publisher expires 48 hours after you create it, unless a publish uses it first. To replace an expired one, revoke it with npm trust revoke --id <id> <package>, then create it again.
  2. After the first release, ask the user to remove the placeholder: npm dist-tag rm <package> placeholder --otp=<code>, then npm unpublish <package>@0.0.0-placeholder --otp=<code>. After 72 hours, npm permits the unpublish only when all of these conditions are true:

The GitHub environment npm allows only the main branch. Add a branch there before you release from it.

Leave prerelease mode

  1. Remove versioning, prerelease and prerelease-type from release-please-config.json.
  2. In the same PR, set release-as on each package to its stable version. A Release-As: footer does not work here, because the commit changes no package files:

```json

"packages/core": { "component": "@awesome-reveal/core", "release-as": "1.0.0" }

```

  1. Make sure that these packages have a feat:, fix: or Release-As: commit since the last release:
  1. Do a dry run, and check that no version has a prerelease suffix. If a version has one, fix the cause from steps 1 to 3, push, and do the dry run again. Merge only when no version has a suffix.
  2. Merge the release PR. The publish job uses latest.
  3. Remove release-as in the first PR after the release.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.