-
Notifications
You must be signed in to change notification settings - Fork 1.4k
103 lines (87 loc) · 3.44 KB
/
main.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
101
102
103
name: PyInstaller
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Install UPX
uses: crazy-max/ghaction-upx@v2
if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
with:
install-only: true
- name: UPX version
if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
run: upx --version
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install face_recognition --no-deps
pip install pyinstaller
- name: Test number_perser.get_number
run: |
python number_parser.py -v
- name: Build with PyInstaller for macos/ubuntu
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: |
pyinstaller \
--onefile Movie_Data_Capture.py \
--python-option u \
--hidden-import "ImageProcessing.cnn" \
--add-data "$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1):cloudscraper" \
--add-data "$(python -c 'import opencc as _; print(_.__path__[0])' | tail -n 1):opencc" \
--add-data "$(python -c 'import face_recognition_models as _; print(_.__path__[0])' | tail -n 1):face_recognition_models" \
--add-data "Img:Img" \
--add-data "scrapinglib:scrapinglib" \
--add-data "config.ini:." \
- name: Build with PyInstaller for windows
if: matrix.os == 'windows-latest'
run: |
pyinstaller `
--onefile Movie_Data_Capture.py `
--python-option u `
--hidden-import "ImageProcessing.cnn" `
--add-data "$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1);cloudscraper" `
--add-data "$(python -c 'import opencc as _; print(_.__path__[0])' | tail -n 1);opencc" `
--add-data "$(python -c 'import face_recognition_models as _; print(_.__path__[0])' | tail -n 1);face_recognition_models" `
--add-data "Img;Img" `
--add-data "scrapinglib;scrapinglib" `
--add-data "config.ini;." `
- name: Copy config.ini
run: |
cp config.ini dist/
- name: Set VERSION variable for macos/ubuntu
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: |
echo "VERSION=$(python Movie_Data_Capture.py --version)" >> $GITHUB_ENV
- name: Set VERSION variable for windows
if: matrix.os == 'windows-latest'
run: |
echo "VERSION=$(python Movie_Data_Capture.py --version)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload build artifact
uses: actions/upload-artifact@v1
with:
name: MDC-${{ env.VERSION }}-${{ runner.os }}-amd64
path: dist
- name: Run test (Ubuntu & MacOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
cd dist
touch IPX-292.mp4
touch STAR-437-C.mp4
touch 122922_001.mp4
./Movie_Data_Capture