generated from sVoxelDev/spigot-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.config.js
110 lines (107 loc) · 3.94 KB
/
release.config.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
const ref = process.env.GITHUB_REF;
const branch = ref.split('/').pop();
const config = {
branches: [
'main',
{ name: "release", prerelease: "rc", channel: "rc" },
{ name: "next", prerelease: "SNAPSHOT", channel: "next" }
],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator'
],
}
if (config.branches.some(it => (it === branch || it.name === branch) && it.prerelease)) {
config.plugins.push(
["@google/semantic-release-replace-plugin", {
"replacements": [
{
"files": ["gradle.properties"],
"from": "version = .*",
"to": "version = ${nextRelease.version.replace(/-SNAPSHOT.*/,'-SNAPSHOT')}",
"countMatches": true
}
]
}],
['@semantic-release/git', {
assets: [
"gradle.properties"
]
}],
["@semantic-release/exec", {
"publishCmd": "./gradlew -PforceSign=true publish --no-daemon"
}],
["@semantic-release/github", {
"assets": [
{
"path": "{bukkit,velocity,bungeecord}/build/libs/*+([0-9]|SNAPSHOT).jar"
}
]
}]
)
} else {
config.plugins.push('@semantic-release/changelog',
["@google/semantic-release-replace-plugin", {
"replacements": [
{
"files": ["gradle.properties"],
"from": "version = .*",
"to": "version = ${nextRelease.version}",
"countMatches": true
},
{
"files": [
"**/src/main/java/**/*.java"
],
"from": "@since next",
"to": "@since ${nextRelease.version}",
"countMatches": true
},
{
"files": [
"**/src/main/java/**/*.java"
],
"from": "since = \"next\"",
"to": "since = \"${nextRelease.version}\"",
"countMatches": true
},
{
"files": [
"docs/**/*.md"
],
"from": "\\[next\\]: https://github.com/sVoxelDev/sChat/releases/latest",
"to": "[next]: https://github.com/sVoxelDev/sChat/releases/latest\n[${nextRelease.version}]: https://github.com/sVoxelDev/sChat/releases/tag/v${nextRelease.version}",
"countMatches": true
},
{
"files": [
"docs/**/*.md"
],
"from": "\\[:octicons-milestone-24: next\\]\\[next\\]",
"to": "[:octicons-milestone-24: ${nextRelease.version}][${nextRelease.version}]",
"countMatches": true
}
]
}],
['@semantic-release/git', {
assets: [
"**/src/main/java/**/*.java",
"docs/**/*.md",
"gradle.properties",
"CHANGELOG.md"
]
}],
["@semantic-release/exec", {
"publishCmd": "./gradlew -PforceSign=true publish closeAndReleaseSonatypeStagingRepository --no-daemon",
"successCmd": "git config --global user.name mkdocs-deploy && git config --global user.email [email protected] && mike deploy --prefix docs --push --update-aliases ${nextRelease.version.replace(/.\d+$/, '')} latest"
}],
["@semantic-release/github", {
"assets": [
{
"path": "{bukkit,velocity,bungeecord}/build/libs/*+([0-9]|SNAPSHOT).jar"
}
]
}]
)
}
module.exports = config