Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
zakiali committed Aug 28, 2024
1 parent 93d810f commit dbe2c70
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- '**'
tags:
- 'v*'

Expand All @@ -27,16 +28,17 @@ jobs:
id: check_version
run: |
NEW_VERSION=$(echo "$GITHUB_REF" | sed -E 's/refs\/tags\/v(.+)/\1/')
CURRENT_VERSION=$(python -c "import toml; from packaging.version import parse as parse_version; print(parse_version(toml.load('pyproject.toml')['project']['version']))")
if python -c "from packaging.version import parse as parse_version; exit(0 if parse_version('$NEW_VERSION') > parse_version('$CURRENT_VERSION') else 1)"; then
echo "::set-output name=new_version::true"
CURRENT_VERSION=$(grep '^version =' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
if python -c "from packaging.version import parse as parse_version; exit(0 if parse_version(${NEW_VERSION}) > parse_version(${CURRENT_VERSION}) else 1)"; then
echo "new_version=true" >> $GITHUB_ENV
else
echo "::set-output name=new_version::false"
echo "new_version=false" >> $GITHUB_ENV
- name: Publish
uses: pypa/[email protected]
if: startsWith(github.ref, 'refs/tags/v') && steps.check_version.outputs.new_version == 'true'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN_TEMP }}
password: ${{ secrets.PYPI_TOKEN_TEMP_DOES_NOT_EXIST }}
packages_dir: ./dist/

0 comments on commit dbe2c70

Please sign in to comment.