-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate-base-voice-callouts.yml
More file actions
92 lines (83 loc) · 3.12 KB
/
Copy pathgenerate-base-voice-callouts.yml
File metadata and controls
92 lines (83 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Generate Base Voice Callouts
# Renders any commandCue whose male mp3 is missing in native-android/res/raw.
# Writes iOS (Audio/ + Audio/female/) and mirrors to Android (raw/ + female_ prefix).
# Use after adding new entries to voice_callouts.json (e.g. new MMA cues).
on:
workflow_dispatch:
inputs:
male_voice_id:
description: ElevenLabs male voice ID (drill sergeant default).
required: false
default: 2EiwWnXFnvU5JabPnv8n
type: string
female_voice_id:
description: ElevenLabs female voice ID (empty skips female render).
required: false
default: EXAVITQu4vr4xnSDxMaL
type: string
model_id:
description: ElevenLabs model ID.
required: false
default: eleven_multilingual_v2
type: string
regenerate_all_male:
description: Regenerate every male bundled cue (not only missing files).
required: false
default: false
type: boolean
permissions:
contents: write
pull-requests: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PROJECT_PAT }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Render missing base voice callouts
env:
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
MALE_VOICE_ID: ${{ inputs.male_voice_id }}
FEMALE_VOICE_ID: ${{ inputs.female_voice_id }}
MODEL_ID: ${{ inputs.model_id }}
REGENERATE_ALL_MALE: ${{ inputs.regenerate_all_male }}
run: |
args=()
if [ "$REGENERATE_ALL_MALE" = "true" ]; then
args+=(--regenerate-all-male)
fi
python scripts/generate_base_voice_callouts.py "${args[@]}"
- name: Upload generated audio
if: always()
uses: actions/upload-artifact@v4
with:
name: base-voice-callouts
path: |
native-ios/RandomTimer/Resources/Audio
native-android/app/src/main/res/raw
retention-days: 1
- name: Create PR with regenerated audio
env:
GH_TOKEN: ${{ secrets.PROJECT_PAT }}
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add \
native-ios/RandomTimer/Resources/Audio \
native-android/app/src/main/res/raw
if git diff --cached --quiet; then
echo "No new audio assets generated."
exit 0
fi
BRANCH="feat/base-voice-callouts-$(date -u +%Y%m%d-%H%M%S)-run-${GITHUB_RUN_ID}"
git checkout -b "$BRANCH"
git commit -m "feat(audio): render missing base voice callouts"
git push origin "$BRANCH"
gh pr create --base develop --head "$BRANCH" \
--title "feat(audio): render missing base voice callouts" \
--body "Auto-generated via dispatch of generate-base-voice-callouts. Fills in any commandCue mp3 missing from res/raw (covers new MMA cues)."