From a45e64e74a759a2f407542a1daa7321d85f6640e Mon Sep 17 00:00:00 2001 From: Hadrien David Date: Sun, 2 Aug 2026 11:16:21 -0400 Subject: [PATCH] fix(ci): restore direct semantic releases --- .github/workflows/release.yml | 10 ++++++---- pyproject.toml | 9 ++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59dddb9..425ebbb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,20 +18,22 @@ jobs: uses: actions/checkout@v7 with: fetch-depth: 0 + token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - name: 🔧 setup uv uses: ./.github/uv - name: 📜 semantic release version & publish on PyPI run: | - RET_CODE=0 - uv run semantic-release --strict version || RET_CODE=$? - if [ $RET_CODE -ne 0 ]; then + next_version=$(uv run semantic-release version --print) + last_released_version=$(uv run semantic-release version --print-last-released) + if [[ "$next_version" == "$last_released_version" ]]; then echo "🙅🏽 Nothing to publish" else + uv run semantic-release --strict version echo "🙆🏽 Publishing on PyPI" uv build uv run twine upload dist/* fi env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} diff --git a/pyproject.toml b/pyproject.toml index 09bc3ad..a644a77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,9 +94,16 @@ env = "GH_TOKEN" [tool.semantic_release] version_toml = ["pyproject.toml:project.version"] allow_zero_version = true +commit_message = """\ +chore(release): v{version} + +Automatically generated by python-semantic-release +""" [tool.semantic_release.commit_parser_options] -patch_tags = ["fix", "perf", "build"] +minor_tags = ["feat"] +patch_tags = ["build", "ci", "docs", "fix", "perf", "refactor", "style", "test"] +other_allowed_tags = ["chore"] [tool.semantic_release.changelog] mode = "init"