Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
name: Bump Version, Tag, and Release

# You can trigger this manually via the Actions tab
on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Ensure the workflow can push changes back
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Get current version from __init__.py
id: get_version
run: |
# Extract the version string from the __init__.py file.
# This regex looks for __version__ = "0.4.4" and extracts 0.4.4.
CURRENT_VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' runware/__init__.py)
echo "Current version: $CURRENT_VERSION"
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV

- name: Bump patch version
id: bump_version
run: |
# Split the version number (assumes semantic versioning: MAJOR.MINOR.PATCH)
IFS='.' read -r major minor patch <<< "$CURRENT_VERSION"
new_patch=$((patch + 1))
NEW_VERSION="${major}.${minor}.${new_patch}"
Expand All @@ -35,15 +35,12 @@ jobs:

- name: Update version in setup.py
run: |
# Replace the version string inside setup.py.
# The regex looks for version="..." and replaces the content with the new version.
sed -i -E "s/(version=)[\"']([^\"']+)[\"']/\1\"$NEW_VERSION\"/" setup.py
echo "setup.py updated:"
grep -E "version=" setup.py

- name: Update version in runware/__init__.py
run: |
# Replace the __version__ string in the __init__.py file.
sed -i -E "s/(__version__\s*=\s*)[\"']([^\"']+)[\"']/\1\"$NEW_VERSION\"/" runware/__init__.py
echo "runware/__init__.py updated:"
grep -E "__version__" runware/__init__.py
Expand All @@ -53,18 +50,19 @@ jobs:
git config user.name "GitHub Action"
git config user.email "action@github.com"
git add setup.py runware/__init__.py
# If nothing changed (for example, if you ran the workflow twice), do not fail.
git commit -m "chore: bump version to $NEW_VERSION" || echo "No changes to commit"

- name: Create new tag
run: |
# Note: the version string in your files remains plain (e.g. "0.4.4")
# but the tag is prefixed with "v", e.g. "v0.4.4".
echo "Using NEW_VERSION=$NEW_VERSION from env"
TAG="v$NEW_VERSION"
echo "Creating tag: $TAG"
# Store TAG in GITHUB_ENV for next step
echo "TAG=$TAG" >> $GITHUB_ENV
git tag "$TAG"

- name: Push commit and tag
run: |
echo "Pushing tag $TAG"
git push origin HEAD
git push origin "$TAG"
2 changes: 1 addition & 1 deletion runware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
from .async_retry import *

__all__ = ["Runware", "IImageBackgroundRemoval"]
__version__ = "0.4.6"
__version__ = "0.4.8"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
setup(
name="runware",
license="MIT",
version="0.4.6",
version="0.4.8",
author="Runware Inc.",
author_email="python.sdk@runware.ai",
description="The Python Runware SDK is used to run image inference with the Runware API, powered by the Runware inference platform. It can be used to generate images with text-to-image and image-to-image. It also allows the use of an existing gallery of models or selecting any model or LoRA from the CivitAI gallery. The API also supports upscaling, background removal, inpainting and outpainting, and a series of other ControlNet models.",
Expand Down