diff --git a/.github/workflows/release-dev.yaml b/.github/workflows/release-dev.yaml index 5c8efd25..93cfddee 100644 --- a/.github/workflows/release-dev.yaml +++ b/.github/workflows/release-dev.yaml @@ -42,16 +42,16 @@ jobs: SEMVER_REGEX="version = \"([0-9]+)\.([0-9]+)\.([0-9]+)([-]{0,1})(((b{0,1})|(rc{0,1}))[\.]{0,1}[0-9]+){0,1}\"" sed -i -E "s/$SEMVER_REGEX/version = \"$NEXT_VERSION\"/g" pyproject.toml + - name: Commit version bump + run: | + git add pyproject.toml + git commit -m "Release: $GITHUB_SHA" + git push --force + - name: Build and publish wheel env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.DJTOOLS_PYPI_TOKEN }} run: | uv build - uv run twine upload dist/* - - - name: Commit changes - run: | - git add pyproject.toml - git commit -m "Release: $GITHUB_SHA" - git push --force + uv run twine upload --skip-existing dist/* diff --git a/.github/workflows/release-prod.yaml b/.github/workflows/release-prod.yaml index aab8db15..13679ab7 100644 --- a/.github/workflows/release-prod.yaml +++ b/.github/workflows/release-prod.yaml @@ -42,16 +42,16 @@ jobs: SEMVER_REGEX="version = \"([0-9]+)\.([0-9]+)\.([0-9]+)([-]{0,1})(((b{0,1})|(rc{0,1}))[\.]{0,1}[0-9]+){0,1}\"" sed -i -E "s/$SEMVER_REGEX/version = \"$NEXT_VERSION\"/g" pyproject.toml + - name: Commit version bump + run: | + git add pyproject.toml + git commit -m "Release: $GITHUB_SHA" + git push --force + - name: Build and publish wheel env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.DJTOOLS_PYPI_TOKEN }} run: | uv build - uv run twine upload dist/* - - - name: Commit changes - run: | - git add pyproject.toml - git commit -m "Release: $GITHUB_SHA" - git push --force + uv run twine upload --skip-existing dist/* diff --git a/src/djtools/version.py b/src/djtools/version.py index 64cf35c0..55d7ec4c 100644 --- a/src/djtools/version.py +++ b/src/djtools/version.py @@ -18,6 +18,7 @@ def get_version() -> str: if match: suffix = version.split(match)[-1] + if suffix and not suffix.startswith("-"): version = f"{match}-{suffix}"