This repository was archived by the owner on May 7, 2024. It is now read-only.
forked from RustFields/RuFi-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.config.js
More file actions
38 lines (38 loc) · 1.32 KB
/
release.config.js
File metadata and controls
38 lines (38 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const config = require('semantic-release-preconfigured-conventional-commits')
const verifyReleaseCommands = `
sed -i 's/version.*/version = "\${nextRelease.version}"/g' Cargo.toml || exit 1
git add -A || exit 2
git commit -m "chore: [skip ci] update version in Cargo.toml" || exit 3
cargo publish --dry-run || exit 4
`
const prepareCommands = `
sed -i 's/version.*/version = "\${nextRelease.version}"/g' Cargo.toml || exit 1
git add -A || exit 2
git commit -m "chore: [skip ci] update version in Cargo.toml" || exit 3
git push --force origin || exit 4
`
const publishCommands = `
git tag -a -f \${nextRelease.version} \${nextRelease.version} -F CHANGELOG.md || exit 1
git push --force origin \${nextRelease.version} || exit 2
cargo package || exit 3
cargo publish || exit 4
`
const releaseBranches = ["main"]
config.branches = releaseBranches
config.plugins.push(
["@semantic-release/exec", {
"prepareCmd": prepareCommands,
"publishCmd": publishCommands,
"verifyReleaseCmd": verifyReleaseCommands,
}],
["@semantic-release/github", {
"assets": [
{ "path": "target/package/*.crate" },
]
}],
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "package.json"],
"message": "chore(release)!: [skip ci] ${nextRelease.version} released"
}],
)
module.exports = config