fix(release): dispatch publish via gh api in exec successCmd
gh workflow run failed inside successCmd (exit 1, no output shown). Switch to gh api REST dispatch which is transparent and reliable. successCmd only runs after semantic-release actually publishes a new version, so this fires once per release, exactly on the new tag. Remove the separate Detect step (it depended on git state that is not updated by semantic-release).
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"@semantic-release/changelog",
|
"@semantic-release/changelog",
|
||||||
["@semantic-release/exec", {
|
["@semantic-release/exec", {
|
||||||
"prepareCmd": "sed -i 's/^version = \\\"[^\\\"]*\\\"/version = \\\"${nextRelease.version}\\\"/' Cargo.toml && cargo check",
|
"prepareCmd": "sed -i 's/^version = \\\"[^\\\"]*\\\"/version = \\\"${nextRelease.version}\\\"/' Cargo.toml && cargo check",
|
||||||
"successCmd": "echo \"::notice::release ${nextRelease.version} published; dispatching crate publish\" && gh workflow run publish.yml --ref main -f tag=v${nextRelease.version}"
|
"successCmd": "gh api -X POST repos/${GITHUB_REPOSITORY}/actions/workflows/publish.yml/dispatches -f ref=main -f 'inputs[tag]=v${nextRelease.version}'"
|
||||||
}],
|
}],
|
||||||
["@semantic-release/git", {
|
["@semantic-release/git", {
|
||||||
"assets": ["Cargo.toml", "Cargo.lock", "CHANGELOG.md"],
|
"assets": ["Cargo.toml", "Cargo.lock", "CHANGELOG.md"],
|
||||||
|
|||||||
Reference in New Issue
Block a user