嗨,我在我的仓库中使用语义发布进行版本控制。在我的 Gitlab 中,当我将分支与 master 合并时,我的标签会根据提交而增加,并且工作正常。有什么方法可以让我获得合并之前的“下一个标签版本”。我想在合并之前将下一个版本写入文件
尝试使用 exec 但它似乎没有运行
我尝试使用 exec 但 exec 没有为我运行(我对语义发布很陌生,我一定在某处做错了什么)
你能把我推向正确的方向吗:)
我的 gitlab Ci 脚本:
semantic_release:
stage: Tag
image: node:12.16
variables:
GITLAB_TOKEN: $TOKEN_ACCESS
before_script:
- npm install -g semantic-release/exec
- npm install -g semantic-release @semantic-release/gitlab-config
script:
- semantic-release -e @semantic-release/gitlab-config @semantic-release/exec
only:
- master
这是我的 package.json:
{
"name": "@semantic-release/npm",
"description": "semantic-release",
"version": "0.0.0-development",
"author": "",
"release": {
"analyzeCommits": "@semantic-release/commit-analyzer",
"generateNotes": "@semantic-release/release-notes-generator",
"publish": "@semantic-release/gitlab",
"success": false,
"fail": false,
"branches": [
"master"
],
"npmPublish": false
},
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/exec", {
"prepareCmd": "./my-build-script.sh ${nextRelease.version}"
}]
]
}
1:30pm
[7:55:10 AM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[7:55:10 AM] [semantic-release] › ℹ The next release version is 0.2.0
[7:55:10 AM] [semantic-release] › ℹ Start step "verifyRelease" of plugin "[Function: verifyRelease]"
[7:55:10 AM] [semantic-release] › ✔ Completed step "verifyRelease" of plugin "[Function: verifyRelease]"
[7:55:10 AM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[7:55:10 AM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[7:55:10 AM] [semantic-release] › ℹ Start step "prepare" of plugin "[Function: prepare]"
[7:55:10 AM] [semantic-release] › ✔ Completed step "prepare" of plugin "[Function: prepare]"
[7:55:12 AM] [semantic-release] › ✔ Created tag v0.2.0
[7:55:12 AM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/gitlab"
[7:55:12 AM] [semantic-release] [@semantic-release/gitlab] › ℹ Verify GitLab authentication
Exec 似乎没有运行