Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
myifeng authored Jun 4, 2024
1 parent b539584 commit 2baed2b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,21 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Get release version
id: get_version
run: echo "::set-output name=VERSION::${GITHUB_REF#refs/tags/}"
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
echo "Release version: $VERSION"
echo ::set-output name=VERSION::$VERSION
else
echo "Not a release tag. Exiting."
exit 1
fi
- name: Update setup.py version
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
sed -i "s/version='0.0.0'/version='$VERSION'/" setup.py
- name: Build and test
run: |
echo "Building package with version ${{ steps.get_version.outputs.VERSION }}"
sed -i "s/version='0.0.0'/version='${{ steps.get_version.outputs.VERSION }}'/" setup.py
python -m build
pip install dist/article_parser-*.whl
pytest --disable-warnings
Expand Down

0 comments on commit 2baed2b

Please sign in to comment.