Skip to content

Commit 1fd4acb

Browse files
JarbasAlclaude
andcommitted
refactor: add named prefix to all STT compat routers
Each compat router now mounts under a prefix that identifies the API vendor: /openai/v1/... OpenAI Whisper /deepgram/v1/... Deepgram /google/v1/... Google Cloud STT /assemblyai/v2/... AssemblyAI /speechmatics/v1/... Speechmatics Benefits: all routers coexist with no path conflicts; Swagger groups by vendor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 11b1272 commit 1fd4acb

File tree

11 files changed

+58
-241
lines changed

11 files changed

+58
-241
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: Run License Tests
22
on:
33
push:
4-
workflow_dispatch:
5-
pull_request:
64
branches:
75
- master
6+
pull_request:
7+
branches:
8+
- dev
9+
workflow_dispatch:
10+
811
jobs:
912
license_tests:
10-
uses: neongeckocom/.github/.github/workflows/license_tests.yml@master
13+
uses: OpenVoiceOS/gh-automations/.github/workflows/license-check.yml@dev
1114
with:
12-
packages-exclude: '^(tqdm|bs4|gradio|bitstruct|attrs|referencing).*'
15+
exclude_packages: '^(tqdm|bs4|gradio|bitstruct|attrs|referencing).*'

.github/workflows/notify_matrix.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/publish_stable.yml

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,12 @@ on:
66

77
jobs:
88
publish_stable:
9-
uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master
9+
if: github.actor != 'github-actions[bot]'
10+
uses: OpenVoiceOS/gh-automations/.github/workflows/publish-stable.yml@dev
1011
secrets: inherit
1112
with:
1213
branch: 'master'
1314
version_file: 'ovos_stt_http_server/version.py'
14-
setup_py: 'setup.py'
15+
publish_pypi: true
16+
sync_dev: true
1517
publish_release: true
16-
17-
publish_pypi:
18-
needs: publish_stable
19-
if: success() # Ensure this job only runs if the previous job succeeds
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v6
23-
with:
24-
ref: master
25-
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
26-
- name: Setup Python
27-
uses: actions/setup-python@v6
28-
with:
29-
python-version: "3.14"
30-
- name: Install Build Tools
31-
run: |
32-
python -m pip install build wheel
33-
- name: version
34-
run: echo "::set-output name=version::$(python setup.py --version)"
35-
id: version
36-
- name: Build Distribution Packages
37-
run: |
38-
python setup.py sdist bdist_wheel
39-
- name: Publish to PyPI
40-
uses: pypa/gh-action-pypi-publish@master
41-
with:
42-
password: ${{secrets.PYPI_TOKEN}}
43-
44-
45-
sync_dev:
46-
needs: publish_stable
47-
if: success() # Ensure this job only runs if the previous job succeeds
48-
runs-on: ubuntu-latest
49-
steps:
50-
- uses: actions/checkout@v6
51-
with:
52-
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
53-
ref: master
54-
- name: Push master -> dev
55-
uses: ad-m/github-push-action@master
56-
with:
57-
github_token: ${{ secrets.GITHUB_TOKEN }}
58-
branch: dev

.github/workflows/release_workflow.yml

Lines changed: 5 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -8,101 +8,16 @@ on:
88

99
jobs:
1010
publish_alpha:
11-
uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master
11+
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
12+
uses: OpenVoiceOS/gh-automations/.github/workflows/publish-alpha.yml@dev
1213
secrets: inherit
1314
with:
1415
branch: 'dev'
1516
version_file: 'ovos_stt_http_server/version.py'
16-
setup_py: 'setup.py'
1717
update_changelog: true
1818
publish_prerelease: true
19+
propose_release: true
1920
changelog_max_issues: 100
20-
21-
notify:
22-
if: github.event.pull_request.merged == true
23-
needs: publish_alpha
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/checkout@v6
27-
- name: Send message to Matrix bots channel
28-
id: matrix-chat-message
29-
uses: fadenb/matrix-chat-message@v0.0.6
30-
with:
31-
homeserver: 'matrix.org'
32-
token: ${{ secrets.MATRIX_TOKEN }}
33-
channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org'
34-
message: |
35-
new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }}
36-
37-
publish_pypi:
38-
needs: publish_alpha
39-
if: success() # Ensure this job only runs if the previous job succeeds
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@v6
43-
with:
44-
ref: dev
45-
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
46-
- name: Setup Python
47-
uses: actions/setup-python@v6
48-
with:
49-
python-version: "3.14"
50-
- name: Install Build Tools
51-
run: |
52-
python -m pip install build wheel
53-
- name: version
54-
run: echo "::set-output name=version::$(python setup.py --version)"
55-
id: version
56-
- name: Build Distribution Packages
57-
run: |
58-
python setup.py sdist bdist_wheel
59-
- name: Publish to PyPI
60-
uses: pypa/gh-action-pypi-publish@master
61-
with:
62-
password: ${{secrets.PYPI_TOKEN}}
63-
64-
65-
propose_release:
66-
needs: publish_alpha
67-
if: success() # Ensure this job only runs if the previous job succeeds
68-
runs-on: ubuntu-latest
69-
steps:
70-
- name: Checkout dev branch
71-
uses: actions/checkout@v6
72-
with:
73-
ref: dev
74-
75-
- name: Setup Python
76-
uses: actions/setup-python@v6
77-
with:
78-
python-version: '3.14'
79-
80-
- name: Get version from setup.py
81-
id: get_version
82-
run: |
83-
VERSION=$(python setup.py --version)
84-
echo "VERSION=$VERSION" >> $GITHUB_ENV
85-
86-
- name: Create and push new branch
87-
run: |
88-
git checkout -b release-${{ env.VERSION }}
89-
git push origin release-${{ env.VERSION }}
90-
91-
- name: Open Pull Request from dev to master
92-
env:
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
run: |
95-
# Variables
96-
BRANCH_NAME="release-${{ env.VERSION }}"
97-
BASE_BRANCH="master"
98-
HEAD_BRANCH="release-${{ env.VERSION }}"
99-
PR_TITLE="Release ${{ env.VERSION }}"
100-
PR_BODY="Human review requested!"
101-
102-
# Create a PR using GitHub API
103-
curl -X POST \
104-
-H "Accept: application/vnd.github+json" \
105-
-H "Authorization: token $GITHUB_TOKEN" \
106-
-d "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$HEAD_BRANCH\",\"base\":\"$BASE_BRANCH\"}" \
107-
https://api.github.com/repos/${{ github.repository }}/pulls
21+
publish_pypi: true
22+
notify_matrix: true
10823

ovos_stt_http_server/routers/assemblyai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class AssemblyAITranscript(BaseModel):
4646

4747
def make_assemblyai_router(model) -> APIRouter:
4848
"""Create AssemblyAI-compatible router (synchronous stub)."""
49-
router = APIRouter(prefix="/v2", tags=["assemblyai"])
49+
router = APIRouter(prefix="/assemblyai/v2", tags=["assemblyai"])
5050

5151
@router.post("/transcript", response_model=AssemblyAITranscript)
5252
def create_transcript(

ovos_stt_http_server/routers/deepgram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class DeepgramResponse(BaseModel):
5252

5353
def make_deepgram_router(model) -> APIRouter:
5454
"""Create Deepgram-compatible router."""
55-
router = APIRouter(tags=["deepgram"])
55+
router = APIRouter(prefix="/deepgram", tags=["deepgram"])
5656

5757
@router.post("/v1/listen", response_model=DeepgramResponse)
5858
async def listen(

ovos_stt_http_server/routers/google_stt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class GoogleSTTResponse(BaseModel):
5050

5151
def make_google_stt_router(model) -> APIRouter:
5252
"""Create Google Cloud STT-compatible router."""
53-
router = APIRouter(tags=["google-stt"])
53+
router = APIRouter(prefix="/google", tags=["google-stt"])
5454

5555
@router.post("/v1/speech:recognize", response_model=GoogleSTTResponse)
5656
def recognize(

ovos_stt_http_server/routers/openai_whisper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def make_openai_whisper_router(model) -> APIRouter:
3737
Returns:
3838
Configured APIRouter with OpenAI-compatible transcription endpoints.
3939
"""
40-
router = APIRouter(tags=["openai-whisper"])
40+
router = APIRouter(prefix="/openai", tags=["openai-whisper"])
4141

4242
async def _transcribe(
4343
file: UploadFile,

ovos_stt_http_server/routers/speechmatics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class SpeechmaticsTranscriptResponse(BaseModel):
5252

5353
def make_speechmatics_router(model) -> APIRouter:
5454
"""Create Speechmatics-compatible router (synchronous stub)."""
55-
router = APIRouter(prefix="/v1", tags=["speechmatics"])
55+
router = APIRouter(prefix="/speechmatics/v1", tags=["speechmatics"])
5656

5757
@router.post("/jobs", response_model=SpeechmaticsJobResponse)
5858
async def create_job(

ovos_stt_http_server/version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
VERSION_BUILD = 5
55
VERSION_ALPHA = 7
66
# END_VERSION_BLOCK
7+
8+
__version__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_BUILD}" + (f"a{VERSION_ALPHA}" if VERSION_ALPHA else "")

0 commit comments

Comments
 (0)