File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 3535 working-directory : ${{ inputs.working_directory }}
3636 run : |
3737 pipx install hatch
38- pipx inject hatch hatchling
38+ pip install build
3939 - name : Handle inputs
4040 shell : bash
4141 run : |
@@ -49,10 +49,12 @@ runs:
4949 echo "PUSH_CHANGES=$PUSH_CHANGES" >> $GITHUB_ENV
5050 # Handle version already bumped
5151 if [ -z "${{ inputs.version }}" ]; then
52- which hatch
53- VERSION=$(hatch project metadata version)
54- echo $VERSION
52+ python -m build --sdist .
53+ # Extract the version from the sdist name, which must be of the from
54+ # {name}-{version}.tar.gz according to PEP 625.
55+ VERSION=$(ls dist/*.tar.gz | rev | cut -d'-' -f 1 | rev | sed 's/.tar.gz//g')
5556 echo "VERSION=$VERSION" >> $GITHUB_ENV
57+ rm -rf dist
5658 else
5759 echo "VERSION=${{ inputs.version}}" >> $GITHUB_ENV
5860 fi
You can’t perform that action at this time.
0 commit comments