-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate-ios-voice-callouts.yml
More file actions
127 lines (113 loc) · 4.18 KB
/
Copy pathgenerate-ios-voice-callouts.yml
File metadata and controls
127 lines (113 loc) · 4.18 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Generate Pro Audio Content
# DEPRECATED: Use monthly-pro-content-release.yml instead.
# Kept as manual-only for ad-hoc voice callout testing.
on:
workflow_dispatch:
inputs:
pack_id:
description: Optional explicit monthly pack ID.
required: false
default: ""
type: string
voice_id:
description: Optional exact ElevenLabs voice ID.
required: false
default: 2EiwWnXFnvU5JabPnv8n
type: string
model_id:
description: ElevenLabs model ID used for synthesis.
required: false
default: eleven_multilingual_v2
type: string
generate_sound_assets:
description: Regenerate monthly Pro alarm sounds.
required: false
default: true
type: boolean
permissions:
contents: write
pull-requests: write
jobs:
generate:
name: Render monthly Pro audio assets
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: Generate monthly Pro audio assets from ElevenLabs
env:
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
DEFAULT_VOICE_ID: 2EiwWnXFnvU5JabPnv8n
PACK_ID_INPUT: ${{ inputs.pack_id }}
VOICE_ID_INPUT: ${{ inputs.voice_id }}
MODEL_ID_INPUT: ${{ inputs.model_id }}
GENERATE_SOUND_INPUT: ${{ inputs.generate_sound_assets }}
run: |
set -euo pipefail
pack_id="${PACK_ID_INPUT:-}"
voice_id="${VOICE_ID_INPUT:-}"
if [ -z "$voice_id" ]; then
voice_id="$DEFAULT_VOICE_ID"
fi
args=(
--manifest content/pro_audio/monthly_pro_audio_packs.json
--voice-id "$voice_id"
--generate-voice-assets
--sync-android-assets
)
if [ -n "$pack_id" ]; then
args+=(--pack-id "$pack_id")
fi
if [ -n "${MODEL_ID_INPUT:-}" ]; then
args+=(--model-id "$MODEL_ID_INPUT")
fi
if [ "${GENERATE_SOUND_INPUT:-true}" = "true" ]; then
args+=(--generate-sound-assets)
fi
python scripts/generate_pro_audio_content.py "${args[@]}"
- name: Upload generated audio assets
if: always()
uses: actions/upload-artifact@v4
with:
name: monthly-pro-audio-content
path: |
content/pro_audio/runtime
native-ios/RandomTimer/Resources/Audio
native-ios/RandomTimer/Resources/Sounds
native-android/app/src/main/assets
native-android/app/src/main/res/raw
retention-days: 1
- name: Create PR with regenerated audio
env:
GH_TOKEN: ${{ secrets.PROJECT_PAT }}
run: |
if git diff --quiet -- \
content/pro_audio/monthly_pro_audio_packs.json \
content/pro_audio/runtime \
native-ios/RandomTimer/Resources/Audio \
native-ios/RandomTimer/Resources/Sounds \
native-android/app/src/main/assets \
native-android/app/src/main/res/raw; then
echo "No audio asset changes detected."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
BRANCH="feat/pro-audio-regen-$(date -u +%Y%m%d-%H%M%S)-run-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
git checkout -b "$BRANCH"
git add \
content/pro_audio/monthly_pro_audio_packs.json \
content/pro_audio/runtime \
native-ios/RandomTimer/Resources/Audio \
native-ios/RandomTimer/Resources/Sounds \
native-android/app/src/main/assets \
native-android/app/src/main/res/raw
git commit -m "chore: regenerate monthly pro audio content"
git push origin "$BRANCH"
gh pr create --base develop --head "$BRANCH" \
--title "chore(audio): regenerate Pro audio content" \
--body "Auto-generated via manual dispatch of generate-ios-voice-callouts workflow."