-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrelease.config.js
More file actions
70 lines (68 loc) · 2.04 KB
/
release.config.js
File metadata and controls
70 lines (68 loc) · 2.04 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
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
const PYPI_REPOSITORY = process.env.PYPI_REPOSITORY || "https://upload.pypi.org/legacy/";
const RELEASE_BRANCH = process.env.RELEASE_BRANCH || "main";
const CHANGELOG_FILE = process.env.CHANGELOG_FILE || "CHANGELOG.md";
const config = {
branches: [RELEASE_BRANCH],
plugins: [
[
"@semantic-release/commit-analyzer",
{
preset: "conventionalcommits",
},
],
[
"@semantic-release/release-notes-generator",
{
preset: "conventionalcommits",
},
],
[
"@semantic-release/changelog",
{
changelogFile: CHANGELOG_FILE,
changelogTitle:
"# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.",
},
],
[
"@semantic-release/exec",
{
verifyConditionsCmd: `if [ 403 != $(curl -X POST -F ":action=file_upload" -u __token__:$PYPI_TOKEN -s -o /dev/null -w "%{http_code}" ${PYPI_REPOSITORY}) ]; then (exit 0); else (echo "Authentication error. Please check the PYPI_TOKEN environment variable." && exit 1); fi`,
prepareCmd: "poetry version ${nextRelease.version}",
publishCmd: `poetry config repositories.repo ${PYPI_REPOSITORY} && poetry publish --build --repository repo --username __token__ --password $PYPI_TOKEN --no-interaction -vvv`,
},
],
[
"@google/semantic-release-replace-plugin",
{
replacements: [
{
files: ["*/__init__.py"],
ignore: ["test/*", "tests/*"],
from: "__version__ = [\"'].*[\"']",
to: '__version__ = "${nextRelease.version}"',
},
],
},
],
[
"@semantic-release/github",
{
assets: [
{ path: "dist/*.tar.gz", label: "sdist" },
{ path: "dist/*.whl", label: "wheel" },
],
successComment:
":tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on PyPI and GitHub.",
failComment: false,
},
],
[
"@semantic-release/git",
{
assets: ["pyproject.toml", "*/__init__.py", CHANGELOG_FILE],
},
],
],
};
module.exports = config;