ebuild v1.0.0 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Promo Video | |
| on: | |
| push: | |
| branches: [master, main] | |
| paths: | |
| - 'promo/**' | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| concurrency: | |
| group: video-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| render-video: | |
| name: Render Promo Video | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Manim, gTTS & dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ffmpeg libcairo2-dev libpango1.0-dev | |
| pip install manim==0.18.1 gTTS | |
| - name: Generate narration audio | |
| run: | | |
| cd promo | |
| python generate_audio.py | |
| ls -lh narration.mp3 | |
| - name: Render promo video (1080p) | |
| run: | | |
| cd promo | |
| manim render -qh --format mp4 promo_scene.py ProductPromo | |
| - name: Merge video + audio into final MP4 | |
| run: | | |
| cd promo | |
| VIDEO=$(find media/videos -name "ProductPromo.mp4" | head -1) | |
| ffmpeg -y -i "$VIDEO" -i narration.mp3 \ | |
| -c:v copy -c:a aac -b:a 192k \ | |
| -map 0:v:0 -map 1:a:0 \ | |
| -shortest \ | |
| ebuild_v1.0_promo.mp4 | |
| echo "Final video:" | |
| ls -lh ebuild_v1.0_promo.mp4 | |
| - name: Upload final video | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ebuild-promo-video | |
| path: promo/ebuild_v1.0_promo.mp4 | |
| retention-days: 90 | |
| - name: Attach to release | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: promo/ebuild_v1.0_promo.mp4 | |
| tag_name: ${{ github.event.release.tag_name }} | |
| fail_on_unmatched_files: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| summary: | |
| name: Video Build Summary | |
| runs-on: ubuntu-latest | |
| needs: render-video | |
| if: always() | |
| steps: | |
| - name: Report | |
| run: | | |
| echo "## Promo Video Build" >> $GITHUB_STEP_SUMMARY | |
| echo "| Detail | Value |" >> $GITHUB_STEP_SUMMARY | |
| echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY | |
| echo "| Product | ebuild |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Audio | gTTS narration |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Render | ${{ needs.render-video.result }} |" >> $GITHUB_STEP_SUMMARY |