Skip to content

Commit 61ff405

Browse files
committed
debug
1 parent ae73af5 commit 61ff405

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

python/pre-publish/action.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runs:
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

0 commit comments

Comments
 (0)