-
Notifications
You must be signed in to change notification settings - Fork 49
92 lines (78 loc) · 2.37 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
# 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:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.9"]
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 dist/requirements_windows.txt
- name: Download FFMPEG
uses: dsaltares/[email protected]
with:
repo: 'GyanD/codexffmpeg'
version: 'tags/6.0'
file: 'ffmpeg-6.0-full_build.7z'
- name: Unit Test
run: |
7z e ffmpeg-6.0-full_build.7z ffmpeg.exe -r
python -m pytest tests/
- name: Build DVR-Scan
run: |
python dist/pre_release.py
pyinstaller dist/dvr-scan.spec
python dist/post_release.py
- name: Assemble Distribution
run: |
7z e -odist/ffmpeg ffmpeg-6.0-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: Test Distribution
run: |
./dist/dvr-scan/dvr-scan -i tests/resources/simple_movement.mp4 -et 5s -df 3
- name: Upload
uses: actions/upload-artifact@v3
with:
name: DVR-Scan-win64_portable
path: dist/dvr-scan
test:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
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