Skip to content

Commit 41950e7

Browse files
authored
Merge pull request #113 from Runware/workflows/bump-version-by-tag
fix workflow for tagging and bumping version automatically
2 parents 7b6d644 + 6c953bb commit 41950e7

3 files changed

Lines changed: 11 additions & 13 deletions

File tree

.github/workflows/tag.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
name: Bump Version, Tag, and Release
22

3-
# You can trigger this manually via the Actions tab
43
on:
54
workflow_dispatch:
65

76
jobs:
87
release:
98
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
id-token: write
12+
1013
steps:
1114
- name: Checkout repository
1215
uses: actions/checkout@v4
1316
with:
14-
# Ensure the workflow can push changes back
1517
token: ${{ secrets.GITHUB_TOKEN }}
18+
fetch-depth: 0
1619

1720
- name: Get current version from __init__.py
1821
id: get_version
1922
run: |
20-
# Extract the version string from the __init__.py file.
21-
# This regex looks for __version__ = "0.4.4" and extracts 0.4.4.
2223
CURRENT_VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' runware/__init__.py)
2324
echo "Current version: $CURRENT_VERSION"
2425
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
2526
2627
- name: Bump patch version
2728
id: bump_version
2829
run: |
29-
# Split the version number (assumes semantic versioning: MAJOR.MINOR.PATCH)
3030
IFS='.' read -r major minor patch <<< "$CURRENT_VERSION"
3131
new_patch=$((patch + 1))
3232
NEW_VERSION="${major}.${minor}.${new_patch}"
@@ -35,15 +35,12 @@ jobs:
3535
3636
- name: Update version in setup.py
3737
run: |
38-
# Replace the version string inside setup.py.
39-
# The regex looks for version="..." and replaces the content with the new version.
4038
sed -i -E "s/(version=)[\"']([^\"']+)[\"']/\1\"$NEW_VERSION\"/" setup.py
4139
echo "setup.py updated:"
4240
grep -E "version=" setup.py
4341
4442
- name: Update version in runware/__init__.py
4543
run: |
46-
# Replace the __version__ string in the __init__.py file.
4744
sed -i -E "s/(__version__\s*=\s*)[\"']([^\"']+)[\"']/\1\"$NEW_VERSION\"/" runware/__init__.py
4845
echo "runware/__init__.py updated:"
4946
grep -E "__version__" runware/__init__.py
@@ -53,18 +50,19 @@ jobs:
5350
git config user.name "GitHub Action"
5451
git config user.email "action@github.com"
5552
git add setup.py runware/__init__.py
56-
# If nothing changed (for example, if you ran the workflow twice), do not fail.
5753
git commit -m "chore: bump version to $NEW_VERSION" || echo "No changes to commit"
5854
5955
- name: Create new tag
6056
run: |
61-
# Note: the version string in your files remains plain (e.g. "0.4.4")
62-
# but the tag is prefixed with "v", e.g. "v0.4.4".
57+
echo "Using NEW_VERSION=$NEW_VERSION from env"
6358
TAG="v$NEW_VERSION"
6459
echo "Creating tag: $TAG"
60+
# Store TAG in GITHUB_ENV for next step
61+
echo "TAG=$TAG" >> $GITHUB_ENV
6562
git tag "$TAG"
6663
6764
- name: Push commit and tag
6865
run: |
66+
echo "Pushing tag $TAG"
6967
git push origin HEAD
7068
git push origin "$TAG"

runware/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
from .async_retry import *
88

99
__all__ = ["Runware", "IImageBackgroundRemoval"]
10-
__version__ = "0.4.6"
10+
__version__ = "0.4.8"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
setup(
77
name="runware",
88
license="MIT",
9-
version="0.4.6",
9+
version="0.4.8",
1010
author="Runware Inc.",
1111
author_email="python.sdk@runware.ai",
1212
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.",

0 commit comments

Comments
 (0)