|
| 1 | +--- |
| 2 | +name: currents-release-package |
| 3 | +description: Release @currents/commit-info to npm — the version and CHANGELOG commit, the PR, the publish workflow and the check of the published package. Use for latest releases and for alpha and beta prereleases. |
| 4 | +argument-hint: <version> [channel] |
| 5 | +--- |
| 6 | + |
| 7 | +# Release @currents/commit-info to npm |
| 8 | + |
| 9 | +Arguments: the version and the npm channel. Without a channel, a version like |
| 10 | +`3.1.0` goes to `latest` and `3.1.0-beta.0` goes to `beta`. Ask for anything |
| 11 | +missing. |
| 12 | + |
| 13 | +Publishing changes the npm package and its dist-tag. The operator runs the |
| 14 | +publish command; give it ready to run with `!`. You prepare the release |
| 15 | +commit, open the PR, merge it when approved, and check the result. |
| 16 | + |
| 17 | +## How releases work here |
| 18 | + |
| 19 | +- `.github/workflows/publish.yaml` publishes. It is started by hand with a |
| 20 | + channel (`alpha`, `beta` or `latest`). It publishes the version in |
| 21 | + `package.json` of the ref it runs on, with npm provenance. |
| 22 | +- The workflow checks that the version fits the channel: `3.1.0` for |
| 23 | + `latest`, `3.1.0-beta.0` for `beta`, `3.1.0-alpha.0` for `alpha`. Then it |
| 24 | + runs the unit tests before it publishes. |
| 25 | +- The repo has no tags or GitHub releases for versions. `CHANGELOG.md` is |
| 26 | + written by hand, with one `## <version>` section per latest release. |
| 27 | +- PRs are merged with a merge commit and need one approval. |
| 28 | + |
| 29 | +## 1. Before you start |
| 30 | + |
| 31 | +- `npm view @currents/commit-info dist-tags` shows what each channel has now. |
| 32 | + The new version must be higher than the channel's current version. |
| 33 | +- Check that no publish run is in progress: |
| 34 | + `gh run list --workflow publish.yaml`. |
| 35 | + |
| 36 | +## 2. Make the release commit |
| 37 | + |
| 38 | +- latest: on the PR that holds the changes, or on a branch |
| 39 | + `release/<version>` from `master`. |
| 40 | +- alpha or beta: on a branch `release/<version>` from the commit to test, |
| 41 | + usually `master` or the head of an open PR. |
| 42 | + |
| 43 | +Then: |
| 44 | + |
| 45 | +- `npm version <version> --no-git-tag-version` sets the version in |
| 46 | + `package.json` and `package-lock.json`. |
| 47 | +- For latest, add a `## <version>` section at the top of `CHANGELOG.md`. Lead |
| 48 | + with what users of the package notice: breaking changes and what callers |
| 49 | + have to change first, then the other changes. The earlier sections show the |
| 50 | + style. Prereleases get no section. |
| 51 | +- Commit with `chore: release <version>`. |
| 52 | + |
| 53 | +## 3. Check the package |
| 54 | + |
| 55 | +- `npm test` (lint, then the unit tests) on Node.js 22 and 24, the versions |
| 56 | + `.github/workflows/main.yml` tests. |
| 57 | +- `npm pack`, install the tarball in an empty folder, and call |
| 58 | + `commitInfo()` in a git repository. `npm ls --omit=dev` there shows the |
| 59 | + runtime dependencies; compare them with the previous version. |
| 60 | +- For a breaking change, check the packages that use commit-info with the |
| 61 | + packed version: `@currents/cmd` in currents-dev/currents-reporter and the |
| 62 | + Currents Playwright reporter. |
| 63 | + |
| 64 | +## 4. PR and merge |
| 65 | + |
| 66 | +For latest: |
| 67 | + |
| 68 | +- Open the PR to `master`, or add the release commit to the PR that holds |
| 69 | + the changes. The body lists the changes, the checks from step 3 with their |
| 70 | + results, and starts with an `Owner: @<login>` line naming the operator. |
| 71 | +- Load the `writing-voice` skill if it is available, and show the body to the |
| 72 | + operator before you open the PR. |
| 73 | +- When CI passes and the PR is approved, merge it with a merge commit: |
| 74 | + `gh pr merge <n> --merge`. |
| 75 | + |
| 76 | +For alpha or beta, push the `release/<version>` branch. It needs no PR: the |
| 77 | +publish runs from the branch. |
| 78 | + |
| 79 | +## 5. Publish |
| 80 | + |
| 81 | +Give the operator the publish command. The ref is `master` for latest, and |
| 82 | +the `release/<version>` branch for alpha or beta: |
| 83 | + |
| 84 | +```bash |
| 85 | +gh workflow run publish.yaml --repo currents-dev/commit-info --ref <ref> -f channel=<channel> |
| 86 | +``` |
| 87 | + |
| 88 | +## 6. Check the published package |
| 89 | + |
| 90 | +- Watch the publish run to the end: `gh run watch <run id> --exit-status`. |
| 91 | +- `npm view @currents/commit-info dist-tags` shows the new version on the |
| 92 | + channel. `npm view @currents/commit-info@<version> dist.attestations` shows |
| 93 | + the provenance. |
| 94 | +- Install the version from npm in an empty folder and repeat the checks from |
| 95 | + step 3. |
| 96 | + |
| 97 | +If the published version is broken, give the operator the commands to move |
| 98 | +the channel back and mark the version: |
| 99 | + |
| 100 | +```bash |
| 101 | +npm dist-tag add @currents/commit-info@<previous version> <channel> |
| 102 | +npm deprecate @currents/commit-info@<version> "<what is broken>; use <previous version>" |
| 103 | +``` |
| 104 | + |
| 105 | +Do not unpublish: lockfiles that already have the version stop installing. |
| 106 | + |
| 107 | +## Report |
| 108 | + |
| 109 | +End with a table of the steps — release commit, PR, merge, publish run, npm |
| 110 | +dist-tag, check from npm — each linked to its PR, run or npm page, with the |
| 111 | +evidence you checked. |
0 commit comments