Skip to content

Commit f125aec

Browse files
committed
docs(readme): clarify release workflow and npm publish steps
Update README to describe new release.yml workflow, tag‑based publishing, and required workflow filename.
1 parent b7665a1 commit f125aec

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,34 @@ commitgen-cc --ci --dry-run --output json --candidates 3
9696

9797
JSON success output now includes `scope`, `ticket`, and `alternatives` when available.
9898

99-
## Automatic npm publish
99+
## Releases and npm publish
100100

101-
This repo publishes automatically from GitHub Actions on pushes to `main` after CI passes, using npm trusted publishing via GitHub OIDC.
101+
This repo runs CI on pushes/PRs, and publishes only when you push a version tag. The release workflow uses npm trusted publishing via GitHub OIDC and also creates a GitHub Release for that same tag.
102102

103103
Setup:
104104

105105
1. Open the npm package settings for `commitgen-cc`.
106106
2. Add a Trusted Publisher for GitHub Actions with:
107107
- owner: `Eaglemann`
108108
- repository: `commitgen-cc`
109-
- workflow filename: `ci.yml`
110-
- branch: `main`
111-
3. Push to `main` from this repository.
109+
- workflow filename: `release.yml`
110+
3. Save the change. npm only allows one trusted publisher per package, so this should replace any previous `ci.yml` entry.
112111

113-
The workflow publishes only when the version in `package.json` is not already on npm. If you push without bumping the version, the publish job will skip instead of failing.
112+
Release flow:
113+
114+
```bash
115+
npm version patch
116+
git push origin main --follow-tags
117+
```
118+
119+
That creates a tag like `v3.1.1`, pushes it, runs the release workflow, publishes the package if that version is not already on npm, and creates a GitHub Release with the packed tarball attached.
114120

115121
Notes:
116122

117123
- No `NPM_TOKEN` GitHub secret is required for trusted publishing.
118-
- The workflow file name matters. npm must trust `ci.yml` exactly.
119-
- The publish job upgrades npm to meet the current trusted-publishing minimum before running `npm publish --provenance`.
120-
- If you later rename the workflow file or split publishing into a different workflow, you must update the trusted publisher configuration on npm.
124+
- The workflow file name matters. npm must trust `release.yml` exactly.
125+
- The tag must match `package.json` exactly. Example: package version `3.1.1` must be pushed as tag `v3.1.1`.
126+
- If you later rename the workflow file, npm must be updated to trust the new filename.
121127

122128
### Exit codes
123129

0 commit comments

Comments
 (0)