Skip to content

Commit f2d23ab

Browse files
committed
feat: update redis client #release
1 parent 6c94415 commit f2d23ab

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# .github/workflows/ci.yml
2-
name: CI (Build & Push Docker)
2+
name: CI (Build & Push Docker + Auto Release)
33

44
on:
55
push:
66
branches: [ "main" ]
7-
tags: [ "v*.*.*" ] # allow v2.0.1 or 2.0.1 (keep only the one you use)
7+
tags: [ "v*.*.*", "*.*.*" ] # supports v2.0.1 or 2.0.1
88
workflow_dispatch: {}
99

1010
env:
@@ -13,7 +13,7 @@ env:
1313
DOCKERFILE: ./Dockerfile
1414

1515
permissions:
16-
contents: read
16+
contents: write # needed to push tags & create releases
1717

1818
jobs:
1919
build-and-push:
@@ -44,7 +44,7 @@ jobs:
4444
uses: docker/metadata-action@v5
4545
with:
4646
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
47-
# Only SemVer on tag events; only latest/branch/sha on branch events
47+
# Only SemVer on tag events; latest/branch/sha on main pushes
4848
tags: |
4949
type=semver,pattern={{version}},enable=${{ github.ref_type == 'tag' }}
5050
type=raw,value=latest,enable=${{ github.ref_type == 'branch' && github.ref_name == 'main' }}
@@ -74,4 +74,40 @@ jobs:
7474
labels: ${{ steps.meta.outputs.labels }}
7575
cache-from: type=gha
7676
cache-to: type=gha,mode=max
77-
provenance: false
77+
provenance: false
78+
79+
auto-release:
80+
needs: build-and-push
81+
if: contains(github.event.head_commit.message, '#release')
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 0 # need full history for tags
88+
89+
- name: Bump patch version and create tag
90+
id: bump
91+
run: |
92+
set -e
93+
LAST=$(git tag -l 'v*' --sort=-v:refname | head -n1)
94+
if [ -z "$LAST" ]; then LAST="v0.0.0"; fi
95+
VER=${LAST#v}
96+
IFS='.' read -r MA MI PA <<<"$VER"
97+
NEW_TAG="v$MA.$MI.$((PA+1))"
98+
echo "New tag: $NEW_TAG"
99+
git config user.name "github-actions[bot]"
100+
git config user.email "github-actions[bot]@users.noreply.github.com"
101+
git tag -a "$NEW_TAG" -m "release $NEW_TAG"
102+
git push origin "$NEW_TAG"
103+
echo "tag=$NEW_TAG" >> $GITHUB_OUTPUT
104+
105+
- name: Create GitHub Release
106+
uses: softprops/action-gh-release@v2
107+
with:
108+
tag_name: ${{ steps.bump.outputs.tag }}
109+
name: Release ${{ steps.bump.outputs.tag }}
110+
body: |
111+
🚀 Automated release from CI.
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎main_demo_released.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,15 @@ def calc_savings(tokens_est: int, price_in: float, price_out: float, frac_in: fl
587587
"""
588588

589589
# ============== APP (layout preservado A/B) ==============
590-
with gr.Blocks(title="Redis LangCache — Demo PT-BR - SemVer: 2.0.2", css=CUSTOM_CSS, elem_id="app-root") as demo:
590+
with gr.Blocks(title="Redis LangCache — Demo PT-BR", css=CUSTOM_CSS, elem_id="app-root") as demo:
591591
st = gr.State({"hits": 0, "misses": 0, "saved_tokens": 0, "saved_usd": 0.0, "history": []})
592592

593593
# Header com logo + links
594594
gr.HTML("""
595595
<div class="app-header">
596596
<div class="brand">
597597
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Redis_logo.svg/2560px-Redis_logo.svg.png" alt="Redis">
598-
<div class="title">Redis LangCache — Demo PT-BR</div>
598+
<div class="title">Redis LangCache — Demo PT-BR - SemVer: v2.0.3 - PR GitHub: gacerioni</div>
599599
</div>
600600
<div class="links">
601601
<a href="https://www.linkedin.com/in/gabrielcerioni/" target="_blank" rel="noopener">💼 LinkedIn do Gabs</a>

0 commit comments

Comments
 (0)