-
Notifications
You must be signed in to change notification settings - Fork 492
132 lines (114 loc) · 4.24 KB
/
build-windows.yml
File metadata and controls
132 lines (114 loc) · 4.24 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
128
129
130
131
132
# Build Portable Windows EXE (x64) Distribution for PySceneDetect
name: Windows Distribution
on:
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- dist/**
- scenedetect/**
- tests/**
- pyproject.toml
- requirements_headless.txt
- .github/workflows/build-windows.yml
push:
paths:
- dist/**
- scenedetect/**
- tests/**
- pyproject.toml
- requirements_headless.txt
- .github/workflows/build-windows.yml
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/fetch-gh-release-asset@1.1.2
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/download-artifact@v4.1.7
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