@@ -55,20 +55,32 @@ jobs:
55
55
- name : Check Next Version (Dry Run)
56
56
id : check_next_version
57
57
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 == ''
58
70
shell : bash
59
71
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 "
63
75
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]}"
67
79
echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT
68
80
echo "next_tag=v$NEXT_VERSION" >> $GITHUB_OUTPUT
69
81
echo "Found next version: $NEXT_VERSION"
70
82
else
71
- # Fallback to current version if can't determine next
83
+ # Fallback to current version
72
84
CURRENT_VERSION=$(grep -m 1 'version = "' pyproject.toml | awk -F'"' '{print $2}' | sed 's/^v//')
73
85
echo "next_version=${CURRENT_VERSION}.dev0" >> $GITHUB_OUTPUT
74
86
echo "next_tag=v${CURRENT_VERSION}.dev0" >> $GITHUB_OUTPUT
0 commit comments