@navels/neal 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/release.md +58 -75
- package/package.json +1 -1
package/docs/release.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Release process
|
|
2
2
|
|
|
3
|
-
Releases
|
|
4
|
-
and
|
|
5
|
-
|
|
3
|
+
Releases start from the manual GitHub Actions `Publish` workflow. The workflow
|
|
4
|
+
checks and stages the npm package, waits for a maintainer's npm approval, then
|
|
5
|
+
creates the matching GitHub tag and release.
|
|
6
6
|
|
|
7
7
|
## Versioning policy
|
|
8
8
|
|
|
@@ -18,9 +18,9 @@ exit codes, or durable run artifacts require a major version.
|
|
|
18
18
|
|
|
19
19
|
Examples:
|
|
20
20
|
|
|
21
|
-
- Patch: `0.
|
|
21
|
+
- Patch: `0.3.2` fixes a defect or compatibility issue without intentionally
|
|
22
22
|
changing documented behavior.
|
|
23
|
-
- Minor before `1.0.0`: `0.
|
|
23
|
+
- Minor before `1.0.0`: `0.4.0` adds a feature or meaningful behavior change
|
|
24
24
|
while the public contract is still settling.
|
|
25
25
|
- Major: `1.0.0` establishes the stable public contract. Later breaking
|
|
26
26
|
contract changes require `2.0.0`, `3.0.0`, and so on.
|
|
@@ -40,105 +40,86 @@ published CLI package:
|
|
|
40
40
|
|
|
41
41
|
An SDK update should land as a normal dependency pull request that updates both
|
|
42
42
|
`package.json` and `pnpm-lock.yaml`, runs normal CI, and records any provider
|
|
43
|
-
compatibility findings.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
compatibility findings. Match the neal release to the user-facing impact: use a
|
|
44
|
+
patch release for a compatibility fix that preserves documented behavior, a
|
|
45
|
+
minor release for behavior changes before `1.0.0`, and a major release after
|
|
46
|
+
`1.0.0` if a documented public contract breaks.
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Prepare a release
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
Bump `package.json.version` and add a nonempty `## [<version>]` section to
|
|
51
|
+
`CHANGELOG.md` in a normal release-preparation pull request:
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
54
|
pnpm version <version> --no-git-tag-version
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Run the
|
|
57
|
+
Run the release gates from the repository root:
|
|
58
58
|
|
|
59
59
|
```sh
|
|
60
60
|
RELEASE_VERSION=<version> RELEASE_DRY_RUN=true pnpm run validate:release
|
|
61
61
|
pnpm typecheck
|
|
62
62
|
pnpm test
|
|
63
|
+
pnpm lint
|
|
63
64
|
pnpm build
|
|
64
65
|
node scripts/verify-package.mjs
|
|
65
66
|
```
|
|
66
67
|
|
|
67
|
-
`validate:release` checks
|
|
68
|
-
|
|
69
|
-
availability, and checks remote `v<version>` tag availability when an `origin`
|
|
70
|
-
remote is configured. Package verification confirms the built CLI and packed
|
|
71
|
-
tarball.
|
|
68
|
+
`validate:release` checks the package version, required metadata, direct SDK
|
|
69
|
+
pins, changelog section, npm version availability, and remote tag availability.
|
|
72
70
|
|
|
73
|
-
##
|
|
71
|
+
## Publish
|
|
74
72
|
|
|
75
|
-
After the release-preparation pull request is merged and normal CI passes,
|
|
76
|
-
|
|
73
|
+
After the release-preparation pull request is merged and normal CI passes, open
|
|
74
|
+
**Actions > Publish > Run workflow** on `main`.
|
|
77
75
|
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
Run it first with the exact version and `dry_run: true`. This runs every gate
|
|
77
|
+
and `npm publish --dry-run` without changing npm or GitHub.
|
|
80
78
|
|
|
81
|
-
|
|
82
|
-
environment, grants `contents: read` and `id-token: write`, installs with
|
|
83
|
-
`pnpm install --frozen-lockfile`, and runs these gates before any publish step:
|
|
79
|
+
Run it again with `dry_run: false` after reviewing the dry run. The workflow:
|
|
84
80
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
1. Runs the same release gates.
|
|
82
|
+
2. Runs `npm stage publish` and writes the stage ID and approval commands to the
|
|
83
|
+
GitHub job summary.
|
|
84
|
+
3. Waits up to 60 minutes for the package to become public.
|
|
85
|
+
4. Verifies npm's signed provenance against the workflow's repository, path,
|
|
86
|
+
branch, and exact commit SHA.
|
|
87
|
+
5. Creates `v<version>` at that commit and a GitHub release from the matching
|
|
88
|
+
changelog section.
|
|
92
89
|
|
|
93
|
-
Review the
|
|
94
|
-
`
|
|
95
|
-
the
|
|
90
|
+
Review the stage with `npm stage view <stage-id>` or
|
|
91
|
+
`npm stage download <stage-id>`. Approve it with 2FA using
|
|
92
|
+
`npm stage approve <stage-id>` or the npmjs.com UI. npm won't publish the
|
|
93
|
+
package until that approval happens.
|
|
96
94
|
|
|
97
|
-
|
|
98
|
-
which places the version in a staged, not-publicly-available state. A
|
|
99
|
-
maintainer then reviews and approves it with 2FA: `npm stage list`,
|
|
100
|
-
`npm stage view <stage-id>` / `npm stage download <stage-id>`, and
|
|
101
|
-
`npm stage approve <stage-id>` (or the npmjs.com UI). Nothing reaches `latest`
|
|
102
|
-
without that human approval, so a compromised workflow cannot ship directly.
|
|
95
|
+
## Recovery
|
|
103
96
|
|
|
104
|
-
|
|
97
|
+
Rerun `Publish` with the same version and `dry_run: false` after a timeout or a
|
|
98
|
+
partial failure. The workflow checks existing state before taking action:
|
|
105
99
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
- If the npm version isn't public, it stages it and waits for approval.
|
|
101
|
+
- If the npm version is public, it skips staging and verifies its signed
|
|
102
|
+
provenance against the current workflow commit.
|
|
103
|
+
- If the tag or GitHub release already exists at the expected commit, it keeps
|
|
104
|
+
it and finishes successfully.
|
|
105
|
+
- If the npm provenance or tag points to another commit, it stops without
|
|
106
|
+
changing the existing release.
|
|
111
107
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
The publish workflow relies on trusted publishing/OIDC and intentionally has no
|
|
115
|
-
npm-token fallback. It grants `id-token: write` for OIDC, keeps repository
|
|
116
|
-
contents read-only, uses the `npm-publish` GitHub environment, and runs
|
|
117
|
-
`npm stage publish` only on the real-publish path (staged publishing requires
|
|
118
|
-
npm >= 11.15.0, so the workflow upgrades npm accordingly).
|
|
119
|
-
|
|
120
|
-
The npm-side configuration for `@navels/neal`:
|
|
108
|
+
If the approval wait times out, approve the existing npm stage before rerunning.
|
|
109
|
+
Do not try to stage the same version a second time.
|
|
121
110
|
|
|
122
|
-
|
|
123
|
-
This blocks every traditional token permanently. Trusted publishers are
|
|
124
|
-
unaffected because they use OIDC, and staged approvals always require a
|
|
125
|
-
maintainer's 2FA.
|
|
126
|
-
- Trusted publisher: owner/repo `navels/neal`, workflow filename
|
|
127
|
-
`publish.yml`, environment `npm-publish`, allowed action **`npm stage
|
|
128
|
-
publish` only** (stage-only, plain `npm publish` is deliberately not
|
|
129
|
-
granted).
|
|
130
|
-
|
|
131
|
-
## Release boundaries
|
|
111
|
+
## Trusted publishing setup
|
|
132
112
|
|
|
133
|
-
The
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
113
|
+
The workflow uses npm trusted publishing with no token fallback. The npm trusted
|
|
114
|
+
publisher is configured for owner/repository `navels/neal`, workflow
|
|
115
|
+
`publish.yml`, environment `npm-publish`, and the **`npm stage publish` only**
|
|
116
|
+
permission. Publishing access requires two-factor authentication and disallows
|
|
117
|
+
traditional tokens.
|
|
138
118
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
119
|
+
The workflow grants `id-token: write` for npm's OpenID Connect authentication
|
|
120
|
+
and `contents: write` for the final tag and GitHub release. The `npm-publish`
|
|
121
|
+
environment accepts only `main`. npm's stage-only permission means the workflow
|
|
122
|
+
can't make a package public without a maintainer's 2FA approval.
|
|
142
123
|
|
|
143
124
|
Official references:
|
|
144
125
|
|
|
@@ -146,5 +127,7 @@ Official references:
|
|
|
146
127
|
<https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow>
|
|
147
128
|
- npm trusted publishing:
|
|
148
129
|
<https://docs.npmjs.com/trusted-publishers/>
|
|
130
|
+
- npm staged packages:
|
|
131
|
+
<https://docs.npmjs.com/staged-publishing/>
|
|
149
132
|
- npm trust command:
|
|
150
133
|
<https://docs.npmjs.com/cli/v11/commands/npm-trust/>
|