You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSON success output now includes `scope`, `ticket`, and `alternatives` when available.
98
98
99
-
## Automatic npm publish
99
+
## Releases and npm publish
100
100
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.
102
102
103
103
Setup:
104
104
105
105
1. Open the npm package settings for `commitgen-cc`.
106
106
2. Add a Trusted Publisher for GitHub Actions with:
107
107
- owner: `Eaglemann`
108
108
- 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.
112
111
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.
114
120
115
121
Notes:
116
122
117
123
- 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.
0 commit comments