-
Notifications
You must be signed in to change notification settings - Fork 51
100 lines (84 loc) · 2.63 KB
/
build-windows.yml
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
# Build Portable Windows EXE (x64) Distribution for DVR-Scan
name: Windows Distribution
on:
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- dist/**
- dvr_scan/**
- tests/**
push:
paths:
- dist/**
- dvr_scan/**
- tests/**
tags:
- v*-release
workflow_dispatch:
env:
ffmpeg_version: "7.1"
UV_SYSTEM_PYTHON: 1
UV_LINK_MODE: "symlink"
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.12"]
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 uv and set the python version
uses: astral-sh/setup-uv@v4
with:
version: "0.5.11"
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
uv pip install --upgrade pip build wheel virtualenv setuptools
uv pip install -r dist/requirements_windows.txt -r docs/requirements.txt
- name: Download FFMPEG
uses: dsaltares/[email protected]
with:
repo: 'GyanD/codexffmpeg'
version: 'tags/${{ env.ffmpeg_version }}'
file: 'ffmpeg-${{ env.ffmpeg_version }}-full_build.7z'
- name: Unit Test
run: |
7z e ffmpeg-${{ env.ffmpeg_version }}-full_build.7z ffmpeg.exe -r
python -m pytest tests/
- name: Build DVR-Scan
run: |
python dist/pre_release.py --use-local-images
pyinstaller dist/dvr-scan.spec
python dist/post_release.py
- name: Assemble Distribution
run: |
7z e -odist/ffmpeg ffmpeg-${{ env.ffmpeg_version }}-full_build.7z LICENSE -r
Move-Item -Path ffmpeg.exe -Destination dist/dvr-scan/ffmpeg.exe
Move-Item -Path dist/ffmpeg/LICENSE -Destination dist/dvr-scan/LICENSE-FFMPEG -Force
- name: Upload
uses: actions/upload-artifact@v4
with:
name: DVR-Scan-win64_portable
path: dist/dvr-scan
test:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
name: DVR-Scan-win64_portable
path: build
- name: Test Artifact
run: |
./build/dvr-scan --version
./build/dvr-scan --license
./build/dvr-scan -i tests/resources/simple_movement.mp4 -so -et 5s -df 3
./build/dvr-scan -i tests/resources/simple_movement.mp4 -et 5s -df 3 -m copy