05-0: update authors and framecount #35
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: Encode Modified Level | |
| on: | |
| push: | |
| paths: | |
| - 'volume/n_levels/*.ltm' | |
| jobs: | |
| encode: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: cmatteperdu/libtas_n_recording:latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Get modified level | |
| id: level | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| FILE=$(git show --name-only --pretty="" | grep '^volume/n_levels/.*\.ltm$' | head -n 1) | |
| if [ -z "$FILE" ]; then | |
| echo "No level modified" | |
| exit 0 | |
| fi | |
| # Extract LEVEL from volume/n_levels/LEVEL.ltm | |
| LEVEL=$(basename "$FILE" .ltm) | |
| echo "Modified level: $LEVEL" | |
| echo "level=$LEVEL" >> $GITHUB_OUTPUT | |
| - name: Encode level | |
| if: steps.level.outputs.level != '' | |
| run: | | |
| mkdir -p output | |
| apt-get update && apt-get install -y xvfb | |
| echo "debug: ${{ steps.level.outputs.level }}".ltm | |
| export XDG_RUNTIME_DIR="$(mktemp -d)" | |
| chmod 700 "$XDG_RUNTIME_DIR" | |
| exit | |
| xvfb-run -a libTAS -n -r $GITHUB_WORKSPACE/n_levels/"${{ steps.level.outputs.level }}".ltm --lua $GITHUB_WORKSPACE/lua/n_ghost.lua -d output/"${{ steps.level.outputs.level }}".mp4 /usr/local/bin/ruffle_desktop -g gl --no-gui --width 792 /home/n_v14.swf | |
| while ffprobe output/"${{ steps.level.outputs.level }}".mp4 2>&1 | grep -q 'moov atom not found' | |
| do | |
| echo "Encoding..." | |
| ls -alh "${{ steps.level.outputs.level }}".mp4 | |
| sleep 1 | |
| done | |
| - name: Upload produced video | |
| if: steps.level.outputs.level != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: encoded-video | |
| path: output/"${{ steps.level.outputs.level }}".mp4 |