What I want to do
Based on the FAQ
I want to update the package.json version number on a new release.
What I did
temp
with a README.md and .gitignore for noderebase -i --root
and change it to feat: initial commit
{
"name": "temp",
"version": "0.0.0-development",
"repository": {
"type": "git",
"url": "git+https://github.com/my-organization/temp.git"
}
}
npm install semantic-release -D
npm install @semantic-release/git -D
npm install @semantic-release/changelog -D
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/git"
]
}
name: Release on push on main branch
on:
push:
branches:
- main
jobs:
release-on-push-on-main-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Install dependencies
run: npm install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --branches main
feat: next commit
The problem
The package.json file won't get updated by the semantic-release-bot. Even after modifying the README.md file and pushing with feat: this should trigger a new release
.
How can I tell semantic-release to push the new package version?
Based on this issue
https://github.com/semantic-release/semantic-release/issues/1593
you also need the npm module.
npm install @semantic-release/npm -D
"private": true,
to your package.json if you don't want to publish to npm.
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git"
]
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.