semantic-release Without npm Publishing
Configure semantic-release for projects that don't publish to npm. Use npmPublish: false to get automated versioning and GitHub releases without npm registry interaction.
Detailed Explanation
Versioning Without npm Publishing
Not every project needs to publish to the npm registry. Private applications, Docker-only projects, or non-JavaScript projects can still benefit from semantic-release's automated versioning.
Configuration
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/npm", {
"npmPublish": false
}],
"@semantic-release/github"
]
}
Why Keep the npm Plugin?
Even with npmPublish: false, the npm plugin still:
- Updates the
versionfield in package.json - Updates package-lock.json
- Ensures the version in your repository matches the release tag
Without package.json
For non-JavaScript projects that don't have a package.json, you can skip the npm plugin entirely:
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/exec", {
"prepareCmd": "echo ${nextRelease.version} > VERSION"
}],
"@semantic-release/github"
]
}
Use Cases for npmPublish: false
- Web applications deployed via Docker or cloud services
- Internal tools that don't need registry publishing
- Go, Rust, Python projects using semantic-release for versioning
- Monorepos where only some packages publish to npm
Version File Generation
Use the exec plugin to write the version to any file format your project needs — a VERSION file, a Python __version__ variable, or a Go constants file.
Use Case
Web applications, microservices, or non-JavaScript projects that want automated semantic versioning and GitHub releases without publishing anything to the npm registry.
Try It — Semantic Release Config Builder
Related Topics
Docker Image Release with semantic-release
Advanced Configuration
Custom Shell Commands with @semantic-release/exec
Plugin Configuration
Basic npm Package Release with semantic-release
Basic Configuration
GitHub Release with Uploaded Assets
Advanced Configuration
Commit Release Artifacts Back to Repository
Advanced Configuration