-
Notifications
You must be signed in to change notification settings - Fork 523
138 lines (120 loc) · 4.66 KB
/
Copy pathbuild-windows.yml
File metadata and controls
138 lines (120 loc) · 4.66 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
133
134
135
136
137
138
# Build Portable Windows EXE (x64) Distribution for PySceneDetect
name: Windows Distribution
on:
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- packaging/**
- scripts/**
- scenedetect/**
- tests/**
- pyproject.toml
- .github/workflows/build-windows.yml
push:
paths:
- packaging/**
- scripts/**
- scenedetect/**
- tests/**
- pyproject.toml
- .github/workflows/build-windows.yml
branches:
- main
- 'releases/**'
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
# Skip scheduled runs in forks: GitHub attributes cron runs to the upstream
# workflow author, who then gets emailed when a fork's nightly build fails.
if: github.repository_owner == 'Breakthrough' || github.event_name != 'schedule'
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.13"]
env:
ffmpeg-version: "8.1"
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip build wheel virtualenv setuptools
pip install .[docs]
pip install --upgrade -r packaging/windows/requirements.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
export PATH="$(pwd):$PATH"
# moviepy.config resolves ffmpeg via imageio_ffmpeg at import time; `--no-binary`
# strips the bundled binary, so point at the GyanD ffmpeg we just extracted
# for both pytest and the subsequent pyinstaller step.
echo "IMAGEIO_FFMPEG_EXE=$(realpath ffmpeg.exe)" >> "$GITHUB_ENV"
python -m pytest -vv
- name: Build PySceneDetect
run: |
python scripts/pre_release.py
pyinstaller packaging/windows/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
Copy-Item -Path packaging/windows/LICENSE-PYTHON -Destination dist/scenedetect/thirdparty/
Copy-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@v6
with:
name: PySceneDetect-win64
path: dist/scenedetect
include-hidden-files: true
test:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v5
with:
repository: Breakthrough/PySceneDetect
ref: resources
- uses: actions/download-artifact@v7
with:
name: PySceneDetect-win64
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