-
Notifications
You must be signed in to change notification settings - Fork 4
/
release.config.js
35 lines (33 loc) · 1.42 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
// Based on https://github.com/bjoluc/semantic-release-config-poetry/blob/main/release.config.js
const PYPI_REPOSITORY = 'https://upload.pypi.org/legacy/';
module.exports = {
branches: ['main'],
plugins: [
['@semantic-release/commit-analyzer', { preset: 'conventionalcommits' }],
['@semantic-release/release-notes-generator', { preset: 'conventionalcommits' }],
['@semantic-release/changelog', { changelogFile: 'docs/CHANGELOG.md' }],
[
'@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 publish --build --username __token__ --password $PYPI_TOKEN --no-interaction -vvv',
},
],
[
'@semantic-release/github',
{
assets: [
{ path: 'dist/*.tar.gz', label: 'sdist' },
{ path: 'dist/*.whl', label: 'wheel' },
],
},
],
[
'@semantic-release/git',
{
assets: ['pyproject.toml', 'docs/CHANGELOG.md'],
},
],
],
};