From 805b245ca91951c1e87c93e9c76d4b0128a21798 Mon Sep 17 00:00:00 2001 From: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:51:07 -0700 Subject: [PATCH] v0.2.1: fix + chore (#585) * fix: icon properties error * chore(ci): run ci on staging + migrations (#575) * fix: eleven labs deployment returning uploaded blob (#583) * fix(eleven-labs): fixed URL path (#584) * fix: eleven labs deployment returning uploaded blob * fix: added better URL pattern --------- Co-authored-by: Aditya Tripathi --- .github/workflows/ci.yml | 8 ++++---- apps/sim/app/api/proxy/tts/route.ts | 20 ++++++++++++++------ apps/sim/components/icons.tsx | 10 +++++----- apps/sim/tools/elevenlabs/tts.ts | 6 ++---- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8e3706e0..5c31192a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [main] + branches: [main, staging] pull_request: - branches: [main] + branches: [main, staging] jobs: test: @@ -56,7 +56,7 @@ jobs: migrations: name: Apply Database Migrations runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging') needs: test steps: - name: Checkout code @@ -73,5 +73,5 @@ jobs: - name: Apply migrations working-directory: ./apps/sim env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} + DATABASE_URL: ${{ github.ref == 'refs/heads/main' && secrets.DATABASE_URL || secrets.STAGING_DATABASE_URL }} run: bunx drizzle-kit push diff --git a/apps/sim/app/api/proxy/tts/route.ts b/apps/sim/app/api/proxy/tts/route.ts index cd199f79f..894caafdf 100644 --- a/apps/sim/app/api/proxy/tts/route.ts +++ b/apps/sim/app/api/proxy/tts/route.ts @@ -1,5 +1,7 @@ import { NextResponse } from 'next/server' import { createLogger } from '@/lib/logs/console-logger' +import { uploadFile } from '@/lib/uploads/storage-client' +import { getBaseUrl } from '@/lib/urls/utils' const logger = createLogger('ProxyTTSAPI') @@ -44,12 +46,18 @@ export async function POST(request: Request) { return new NextResponse('Empty audio received', { status: 422 }) } - return new NextResponse(audioBlob, { - headers: { - 'Content-Type': 'audio/mpeg', - 'Cache-Control': 'public, max-age=86400', // Cache for a day - 'Access-Control-Allow-Origin': '*', // CORS support - }, + // Upload the audio file to storage and return multiple URL options + const audioBuffer = Buffer.from(await audioBlob.arrayBuffer()) + const timestamp = Date.now() + const fileName = `elevenlabs-tts-${timestamp}.mp3` + const fileInfo = await uploadFile(audioBuffer, fileName, 'audio/mpeg') + + // Generate the full URL for external use using the configured base URL + const audioUrl = `${getBaseUrl()}${fileInfo.path}` + + return NextResponse.json({ + audioUrl, + size: fileInfo.size, }) } catch (error) { logger.error('Error proxying TTS:', error) diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index 57231f378..48a297c42 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -3014,11 +3014,11 @@ export const AzureIcon = (props: SVGProps) => ( y2='11.8734' gradientUnits='userSpaceOnUse' > - - - - - + + + + +