Skip to content

Commit 6a53676

Browse files
VinciGit00claude
andcommitted
chore(ci): wire semantic-release to pyproject.toml and fix PyPI publish
Release workflow previously loaded @semantic-release/npm by default (no config file present), bumping a phantom package.json and skipping PyPI entirely. Add .releaserc.json that uses @semantic-release/exec to bump pyproject.toml and @semantic-release/git to commit it, leaving PyPI upload to the publish workflow. Publish workflow replaces the broken "uv pip install twine" step (no venv → exits 2) with uv publish, and runs the full test suite instead of just test_client.py. Both workflows gain workflow_dispatch for manual retries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1a0d408 commit 6a53676

3 files changed

Lines changed: 28 additions & 18 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Publish to PyPI
33
on:
44
release:
55
types: [published]
6+
workflow_dispatch:
67

78
jobs:
89
test:
@@ -11,7 +12,7 @@ jobs:
1112
- uses: actions/checkout@v4
1213
- uses: astral-sh/setup-uv@v3
1314
- run: uv sync --frozen
14-
- run: uv run pytest tests/test_client.py -v
15+
- run: uv run pytest tests/ -v
1516

1617
publish:
1718
needs: test
@@ -25,8 +26,5 @@ jobs:
2526

2627
- name: Publish to PyPI
2728
env:
28-
TWINE_USERNAME: __token__
29-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
30-
run: |
31-
uv pip install twine
32-
uv run twine upload dist/*
29+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
30+
run: uv publish

.github/workflows/release.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Release
33
on:
44
push:
55
branches: [main]
6+
workflow_dispatch:
67

78
jobs:
89
release:
@@ -11,36 +12,26 @@ jobs:
1112
contents: write
1213
issues: write
1314
pull-requests: write
14-
id-token: write
1515
steps:
1616
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919
persist-credentials: false
2020

21-
- uses: astral-sh/setup-uv@v3
22-
2321
- uses: actions/setup-node@v4
2422
with:
2523
node-version: 20
2624

27-
- name: Build
28-
run: |
29-
uv sync --frozen
30-
uv build
31-
3225
- name: Semantic Release
3326
uses: cycjimmy/semantic-release-action@v4
3427
env:
3528
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
3729
with:
3830
semantic_version: 23
3931
extra_plugins: |
40-
semantic-release-pypi@3
41-
@semantic-release/git
32+
@semantic-release/exec@6
33+
@semantic-release/git@10
4234
@semantic-release/commit-analyzer@12
4335
@semantic-release/release-notes-generator@13
4436
@semantic-release/github@10
45-
@semantic-release/changelog@6
4637
conventional-changelog-conventionalcommits@7

.releaserc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/exec",
8+
{
9+
"prepareCmd": "sed -i 's/^version = \".*\"/version = \"${nextRelease.version}\"/' pyproject.toml"
10+
}
11+
],
12+
[
13+
"@semantic-release/git",
14+
{
15+
"assets": ["pyproject.toml"],
16+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
17+
}
18+
],
19+
"@semantic-release/github"
20+
]
21+
}

0 commit comments

Comments
 (0)