Skip to content

Windows Distribution #696

Windows Distribution

Windows Distribution #696

Workflow file for this run

# Build Portable Windows EXE (x64) Distribution for PySceneDetect
name: Windows Distribution
on:
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- dist/**
- scenedetect/**
- tests/**
push:
paths:
- dist/**
- scenedetect/**
- tests/**
branches:
- main
- 'releases/**'
tags:
- v*-release
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.13"]
env:
ffmpeg-version: "7.1"
IMAGEIO_FFMPEG_EXE: ""
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip build wheel virtualenv setuptools
pip install -r docs/requirements.txt
pip install --upgrade -r dist/requirements_windows.txt --no-binary imageio-ffmpeg
- name: Download Resources
run: |
git fetch --depth=1 https://github.com/Breakthrough/PySceneDetect.git refs/heads/resources:refs/remotes/origin/resources
git checkout refs/remotes/origin/resources -- tests/resources/
- name: Download FFMPEG ${{ env.ffmpeg-version }}
uses: dsaltares/[email protected]
with:
repo: 'GyanD/codexffmpeg'
version: 'tags/${{ env.ffmpeg-version }}'
file: 'ffmpeg-${{ env.ffmpeg-version }}-full_build.7z'
- name: Unit Test
shell: bash
run: |
7z e ffmpeg-${{ env.ffmpeg-version }}-full_build.7z ffmpeg.exe -r
echo "IMAGEIO_FFMPEG_EXE=`realpath ffmpeg.exe`" >> "$GITHUB_ENV"
python -m pytest -vv
- name: Build PySceneDetect
run: |
python dist/pre_release.py
pyinstaller dist/scenedetect.spec
- name: Build Documentation
run: |
sphinx-build -b singlehtml docs dist/scenedetect/docs
rm -r dist/scenedetect/docs/.doctrees
- name: Assemble Portable Distribution
run: |
Move-Item -Path LICENSE -Destination dist/scenedetect/
New-Item -Path dist/scenedetect/ -Name thirdparty -ItemType Directory
Move-Item -Path dist/windows/README* -Destination dist/scenedetect/
Move-Item -Path dist/windows/LICENSE* -Destination dist/scenedetect/thirdparty/
Move-Item -Path scenedetect/_thirdparty/LICENSE* -Destination dist/scenedetect/thirdparty/
7z e -odist/ffmpeg ffmpeg-${{ env.ffmpeg-version }}-full_build.7z LICENSE -r
Move-Item -Path ffmpeg.exe -Destination dist/scenedetect/ffmpeg.exe
Move-Item -Path dist/ffmpeg/LICENSE -Destination dist/scenedetect/thirdparty/LICENSE-FFMPEG
- name: Test Portable Distribution
run: |
./dist/scenedetect/scenedetect -i tests/resources/goldeneye.mp4 detect-content time -e 2s
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: PySceneDetect-win64_portable
path: dist/scenedetect
include-hidden-files: true
test:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
ref: resources
- uses: actions/[email protected]
with:
name: PySceneDetect-win64_portable
path: build
- name: Test
run: |
echo Testing binary
./build/scenedetect version
echo Test OpenCV
./build/scenedetect -i tests/resources/goldeneye.mp4 -b opencv detect-content time --end 10s
echo Test PyAV
./build/scenedetect -i tests/resources/goldeneye.mp4 -b pyav detect-content time --end 10s
echo Test moviepy
./build/scenedetect -i tests/resources/goldeneye.mp4 -b moviepy detect-content time --end 10s
echo Test split-video + ffmpeg
./build/scenedetect -i tests/resources/goldeneye.mp4 detect-content time --end 10s split-video