generated from aequitas-aod/template-python-project-poetry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.config.js
44 lines (37 loc) · 1.29 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
var dryRun = (process.env.RELEASE_DRY_RUN || "false").toLowerCase() === "true";
var testPypi = (process.env.RELEASE_TEST_PYPI || "false").toLowerCase() === "true";
var pypiUsername = process.env.PYPI_USERNAME;
var pypiPassword = process.env.PYPI_PASSWORD;
var prepareCmd = "poetry version -- \${nextRelease.version}";
var publishCmd = `poetry publish --build --username ${pypiUsername} --password ${pypiPassword}`;
if (testPypi) {
// test-pypi repository name is defined in poetry.toml
publishCmd = publishCmd.replace("--build", "--build --repository pypi-test");
}
if (dryRun) {
publishCmd = publishCmd.replace("--build", "--build --dry-run");
}
var config = require('semantic-release-preconfigured-conventional-commits');
config.plugins.push(
["@semantic-release/exec", {
"prepareCmd" : prepareCmd,
"publishCmd": publishCmd,
}]
)
if (!dryRun) {
config.plugins.push(
["@semantic-release/github", {
"assets": [
{ "path": "dist/*" },
]
}],
["@semantic-release/git", {
"assets": [
"CHANGELOG.md",
"pyproject.toml"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
);
}
module.exports = config