@@ -55,20 +55,32 @@ jobs:
5555 - name : Check Next Version (Dry Run)
5656 id : check_next_version
5757 if : steps.set_mode.outputs.is_dry_run == 'true' && steps.release_dryrun.outputs.version == ''
58+ uses : python-semantic-release/python-semantic-release@v9.20.0
59+ with :
60+ github_token : ${{ secrets.GITHUB_TOKEN }}
61+ push : " false"
62+ commit : " false"
63+ tag : " false"
64+ changelog : " false"
65+ root_options : " ${{ inputs.debug && '-vv --noop --verbosity=INFO' || '-v --noop --verbosity=INFO' }}"
66+
67+ - name : Extract Next Version Info
68+ id : extract_next_version
69+ if : steps.set_mode.outputs.is_dry_run == 'true' && steps.release_dryrun.outputs.version == ''
5870 shell : bash
5971 run : |
60- # Run semantic-release with --noop to find next version without making changes
61- OUTPUT =$(python -m semantic_release version --noop )
62- echo "Output from semantic-release : $OUTPUT "
72+ # Get output from the action logs
73+ VERSION_LINE =$(cat $GITHUB_STEP_SUMMARY | grep -o "New version will be.*" )
74+ echo "Log line : $VERSION_LINE "
6375
64- # Extract next version from output
65- NEXT_VERSION=$(echo "$OUTPUT" | grep -oP 'would bump version to \K [0-9]+\.[0-9]+\.[0-9]+' || echo "")
66- if [ -n "$ NEXT_VERSION" ]; then
76+ # Extract the version number
77+ if [[ $VERSION_LINE =~ New\ version\ will\ be\ ( [0-9]+\.[0-9]+\.[0-9]+) ]]; then
78+ NEXT_VERSION="${BASH_REMATCH[1]}"
6779 echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT
6880 echo "next_tag=v$NEXT_VERSION" >> $GITHUB_OUTPUT
6981 echo "Found next version: $NEXT_VERSION"
7082 else
71- # Fallback to current version if can't determine next
83+ # Fallback to current version
7284 CURRENT_VERSION=$(grep -m 1 'version = "' pyproject.toml | awk -F'"' '{print $2}' | sed 's/^v//')
7385 echo "next_version=${CURRENT_VERSION}.dev0" >> $GITHUB_OUTPUT
7486 echo "next_tag=v${CURRENT_VERSION}.dev0" >> $GITHUB_OUTPUT
0 commit comments