AIGoose commited on
Commit
efd8a15
·
1 Parent(s): b10b75c

fix: merge duplicate env: blocks in Upload step — was causing startup_failure

Browse files
.github/workflows/render-testimonial.yml CHANGED
@@ -14,7 +14,7 @@ on:
14
  participant_role:
15
  description: 'Participant role / org'
16
  required: false
17
- default: 'AI Transformation Series · 2026'
18
  pull_quote:
19
  description: 'Pull quote (strongest line, Indonesian)'
20
  required: false
@@ -52,7 +52,7 @@ jobs:
52
  - name: Download testimonial MOV from Google Drive
53
  run: |
54
  mkdir -p assets project/assets
55
- python3 - <<'EOF'
56
  import gdown, os, sys
57
  fid = "${{ github.event.inputs.gdrive_file_id }}"
58
  out = "assets/raw.MOV"
@@ -60,7 +60,7 @@ jobs:
60
  if not os.path.exists(out):
61
  print("ERROR: download failed"); sys.exit(1)
62
  print(f"Downloaded {os.path.getsize(out)/1024/1024:.1f} MB")
63
- EOF
64
 
65
  - name: Convert + downscale MOV to 720p MP4
66
  run: |
@@ -71,13 +71,8 @@ jobs:
71
  assets/source.mp4
72
  echo "Source: $(du -sh assets/source.mp4)"
73
 
74
- - name: Trim pauses + interviewer sections (ffmpeg)
75
  run: |
76
- # Silence map from analysis:
77
- # 0-71s: clean continuous speech
78
- # 71-77s: 4-pause cluster (cut it)
79
- # 77-87s: more speech (keep)
80
- # 87-90s: trailing silence (cut)
81
  ffmpeg -y \
82
  -i assets/source.mp4 \
83
  -filter_complex "\
@@ -93,26 +88,22 @@ jobs:
93
  DUR=$(ffprobe -v quiet -show_entries format=duration \
94
  -of default=noprint_wrappers=1:nokey=1 assets/trimmed.mp4 | cut -d. -f1)
95
  echo "VIDEO_DURATION=$DUR" >> $GITHUB_ENV
96
- echo "Trimmed duration: ${DUR}s (was 90s)"
97
 
98
- - name: Transcribe + generate SRT captions (Whisper via HF)
99
  env:
100
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
101
  run: |
 
102
  python3 scripts/gen_captions.py \
103
  --input assets/trimmed.mp4 \
104
  --srt-out project/assets/captions.srt
105
- echo "SRT preview:"
106
  head -20 project/assets/captions.srt || true
107
 
108
  - name: Download CC0 music track
109
  run: |
110
- # Kevin MacLeod "Acoustic Breeze" — CC BY 3.0 (free for any use with credit)
111
- python3 - <<'EOF'
112
- import urllib.request, os
113
- # Using a GitHub-hosted CC0 acoustic track (no auth needed from GH Actions)
114
- url = "https://github.com/anars/blank-audio/raw/master/15-seconds-of-silence.mp3"
115
- # Try pixabay (no auth in CI environment)
116
  try:
117
  urllib.request.urlretrieve(
118
  "https://incompetech.com/music/royalty-free/mp3-royaltyfree/Acoustic%20Breeze.mp3",
@@ -124,14 +115,12 @@ jobs:
124
  else:
125
  raise Exception("File too small")
126
  except Exception as e:
127
- print(f"Music download failed: {e} — using silence placeholder")
128
- # Silence placeholder so render doesnt fail
129
- import subprocess
130
  subprocess.run(["ffmpeg","-y","-f","lavfi","-i","anullsrc=r=44100:cl=stereo",
131
- "-t","90","-q:a","9","-acodec","libmp3lame","project/assets/music.mp3"],
132
- capture_output=True)
133
  print("Silence placeholder created")
134
- EOF
135
 
136
  - name: Build project folder
137
  run: |
@@ -143,10 +132,9 @@ jobs:
143
  --role "${{ github.event.inputs.participant_role }}" \
144
  --quote "${{ github.event.inputs.pull_quote }}" \
145
  --duration "$VIDEO_DURATION"
146
- echo "Project contents:"
147
  ls -lh project/ project/assets/
148
 
149
- - name: Render video (720x1280 @ 24fps · Bright Studio)
150
  env:
151
  HYPERFRAMES_BROWSER_PATH: ${{ env.HYPERFRAMES_BROWSER_PATH }}
152
  run: |
@@ -163,13 +151,13 @@ jobs:
163
  - name: Upload to Hugging Face dataset
164
  env:
165
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
166
  run: |
167
- python3 - <<'EOF'
168
  import os
169
  from huggingface_hub import HfApi
170
  api = HfApi(token=os.environ["HF_TOKEN"])
171
- out = os.environ["OUTPUT_FILE"]
172
- name = os.environ.get("PARTICIPANT_NAME", "testimoni")
173
  fname = os.path.basename(out)
174
  api.upload_file(
175
  path_or_fileobj=out,
@@ -180,9 +168,7 @@ jobs:
180
  url = f"https://huggingface.co/datasets/AIgoose/video-renders/resolve/main/renders/{fname}"
181
  print(f"Video ready: {url}")
182
  print(f"::notice title=Video Ready::{url}")
183
- EOF
184
- env:
185
- PARTICIPANT_NAME: ${{ github.event.inputs.participant_name }}
186
 
187
  - name: Upload artifact (backup)
188
  uses: actions/upload-artifact@v4
 
14
  participant_role:
15
  description: 'Participant role / org'
16
  required: false
17
+ default: 'AI Transformation Series 2026'
18
  pull_quote:
19
  description: 'Pull quote (strongest line, Indonesian)'
20
  required: false
 
52
  - name: Download testimonial MOV from Google Drive
53
  run: |
54
  mkdir -p assets project/assets
55
+ python3 - <<'PYEOF'
56
  import gdown, os, sys
57
  fid = "${{ github.event.inputs.gdrive_file_id }}"
58
  out = "assets/raw.MOV"
 
60
  if not os.path.exists(out):
61
  print("ERROR: download failed"); sys.exit(1)
62
  print(f"Downloaded {os.path.getsize(out)/1024/1024:.1f} MB")
63
+ PYEOF
64
 
65
  - name: Convert + downscale MOV to 720p MP4
66
  run: |
 
71
  assets/source.mp4
72
  echo "Source: $(du -sh assets/source.mp4)"
73
 
74
+ - name: Trim pauses and interviewer sections
75
  run: |
 
 
 
 
 
76
  ffmpeg -y \
77
  -i assets/source.mp4 \
78
  -filter_complex "\
 
88
  DUR=$(ffprobe -v quiet -show_entries format=duration \
89
  -of default=noprint_wrappers=1:nokey=1 assets/trimmed.mp4 | cut -d. -f1)
90
  echo "VIDEO_DURATION=$DUR" >> $GITHUB_ENV
91
+ echo "Trimmed: ${DUR}s (was 90s)"
92
 
93
+ - name: Transcribe and generate SRT captions
94
  env:
95
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
96
  run: |
97
+ mkdir -p project/assets
98
  python3 scripts/gen_captions.py \
99
  --input assets/trimmed.mp4 \
100
  --srt-out project/assets/captions.srt
 
101
  head -20 project/assets/captions.srt || true
102
 
103
  - name: Download CC0 music track
104
  run: |
105
+ python3 - <<'PYEOF'
106
+ import urllib.request, os, subprocess
 
 
 
 
107
  try:
108
  urllib.request.urlretrieve(
109
  "https://incompetech.com/music/royalty-free/mp3-royaltyfree/Acoustic%20Breeze.mp3",
 
115
  else:
116
  raise Exception("File too small")
117
  except Exception as e:
118
+ print(f"Music download failed: {e} — generating silence placeholder")
 
 
119
  subprocess.run(["ffmpeg","-y","-f","lavfi","-i","anullsrc=r=44100:cl=stereo",
120
+ "-t","90","-q:a","9","-acodec","libmp3lame",
121
+ "project/assets/music.mp3"], capture_output=True)
122
  print("Silence placeholder created")
123
+ PYEOF
124
 
125
  - name: Build project folder
126
  run: |
 
132
  --role "${{ github.event.inputs.participant_role }}" \
133
  --quote "${{ github.event.inputs.pull_quote }}" \
134
  --duration "$VIDEO_DURATION"
 
135
  ls -lh project/ project/assets/
136
 
137
+ - name: Render video (720x1280 @ 24fps)
138
  env:
139
  HYPERFRAMES_BROWSER_PATH: ${{ env.HYPERFRAMES_BROWSER_PATH }}
140
  run: |
 
151
  - name: Upload to Hugging Face dataset
152
  env:
153
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
154
+ PARTICIPANT_NAME: ${{ github.event.inputs.participant_name }}
155
  run: |
156
+ python3 - <<'PYEOF'
157
  import os
158
  from huggingface_hub import HfApi
159
  api = HfApi(token=os.environ["HF_TOKEN"])
160
+ out = os.environ["OUTPUT_FILE"]
 
161
  fname = os.path.basename(out)
162
  api.upload_file(
163
  path_or_fileobj=out,
 
168
  url = f"https://huggingface.co/datasets/AIgoose/video-renders/resolve/main/renders/{fname}"
169
  print(f"Video ready: {url}")
170
  print(f"::notice title=Video Ready::{url}")
171
+ PYEOF
 
 
172
 
173
  - name: Upload artifact (backup)
174
  uses: actions/upload-artifact@v4