Skip to content

Commit 055203c

Browse files
committed
fix(release): auto-update version from release tag and bump to 3.2.2
- Update version to 3.2.2 in pyproject.toml and __init__.py to match release tag - Add workflow steps to automatically extract version from release tag - Update code files with correct version before building package - Prevents "file already exists" errors on PyPI by ensuring version matches tag
1 parent 3853ad8 commit 055203c

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.github/workflows/python-publish.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ jobs:
2727
uses: actions/setup-python@v3
2828
with:
2929
python-version: '3.x'
30+
- name: Extract version from tag
31+
id: get_version
32+
run: |
33+
if [ "${{ github.event_name }}" == "release" ]; then
34+
VERSION="${{ github.event.release.tag_name }}"
35+
# Remove 'v' prefix if present
36+
VERSION="${VERSION#v}"
37+
echo "version=$VERSION" >> $GITHUB_OUTPUT
38+
fi
39+
- name: Update version in code
40+
if: github.event_name == 'release'
41+
run: |
42+
VERSION="${{ steps.get_version.outputs.version }}"
43+
# Update pyproject.toml
44+
sed -i "s/version = \".*\"/version = \"$VERSION\"/" pyproject.toml
45+
# Update __init__.py
46+
sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/" onelogin/__init__.py
47+
echo "Updated version to $VERSION"
3048
- name: Install dependencies
3149
run: |
3250
python -m pip install --upgrade pip

onelogin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010

1111

12-
__version__ = "3.2.1"
12+
__version__ = "3.2.2"
1313

1414
# import apis into sdk package
1515
from onelogin.api.api_auth_claims_api import APIAuthClaimsApi

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "onelogin"
3-
version = "3.2.1"
3+
version = "3.2.2"
44
description = "OneLogin API Python SDK"
55
authors = [
66
{name = "OneLogin", email = "developers@onelogin.com"}

0 commit comments

Comments
 (0)