Skip to content

Commit 1ee332d

Browse files
committed
ci: run semantic-release through its action again
The Release workflow ran python-semantic-release directly, pinned to 10.6.1 with GitPython 3.1.59, because GitPython 3.1.60 removed Actor.name_email_regex and crashed every config load inside the action (python-semantic-release/python-semantic-release#1476). PSR 10.6.2 ships the fix, so the action step comes back as it was, and releases follow the v10 line again instead of a frozen version.
1 parent ade3bec commit 1ee332d

1 file changed

Lines changed: 17 additions & 34 deletions

File tree

‎.github/workflows/release.yaml‎

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -81,44 +81,27 @@ jobs:
8181
- name: Pytest
8282
run: uv run pytest -n auto --maxprocesses 4
8383

84-
# Runs PSR directly instead of python-semantic-release/python-semantic-release@v10:
85-
# the action installs its dependencies unpinned at image build, and GitPython
86-
# 3.1.60 removed Actor.name_email_regex, which crashes PSR's config load
87-
# (python-semantic-release/python-semantic-release#1476). Restore the action
88-
# once a PSR release ships the fix. The venv python provides the pip that the
89-
# configured build_command bootstraps uv with.
9084
- name: Release
9185
id: release
92-
env:
93-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
94-
run: |
95-
/usr/bin/python3 -m venv "$RUNNER_TEMP/psr"
96-
"$RUNNER_TEMP/psr/bin/pip" install --quiet "python-semantic-release==10.6.1" "gitpython==3.1.59"
97-
export PATH="$RUNNER_TEMP/psr/bin:$PATH"
98-
99-
git config user.name "Semantic Release"
100-
git config user.email "${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
101-
102-
flags=(--commit --tag --vcs-release --prerelease-token rc)
103-
if [ "${{ inputs.release_type }}" = "release-candidate" ]; then
104-
flags+=(--as-prerelease --no-changelog)
105-
else
106-
flags+=(--changelog)
107-
fi
86+
uses: python-semantic-release/python-semantic-release@v10
87+
with:
88+
prerelease: ${{ inputs.release_type == 'release-candidate' }}
89+
prerelease_token: rc
10890
# Force a bump level when the commit history alone wouldn't trigger a
109-
# release (only chore/refactor since the last tag). "auto" = let PSR
91+
# release (only chore/refactor since the last tag). Empty = let PSR
11092
# decide from the Conventional Commits, the normal path.
111-
if [ "${{ inputs.force }}" != "auto" ]; then
112-
flags+=(--${{ inputs.force }})
113-
fi
114-
115-
before=$(git rev-parse HEAD)
116-
semantic-release -v version "${flags[@]}"
117-
if [ "$(git rev-parse HEAD)" != "$before" ]; then
118-
echo "released=true" >> "$GITHUB_OUTPUT"
119-
else
120-
echo "released=false" >> "$GITHUB_OUTPUT"
121-
fi
93+
force: ${{ inputs.force != 'auto' && inputs.force || '' }}
94+
# Runs the configured build_command (`uv lock`) so the release
95+
# commit carries a lock file consistent with the stamped versions.
96+
# The actual package build happens in the publish step below.
97+
build: true
98+
changelog: ${{ inputs.release_type == 'stable' }}
99+
commit: true
100+
tag: true
101+
vcs_release: true
102+
github_token: ${{ steps.app-token.outputs.token }}
103+
git_committer_email: "${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
104+
git_committer_name: "Semantic Release"
122105

123106
- name: Build & Publish
124107
if: steps.release.outputs.released == 'true'

0 commit comments

Comments
 (0)