Update main.yml

This commit is contained in:
Yoshiko2
2023-08-07 03:21:07 +08:00
committed by GitHub
parent 40482ce04b
commit a63e1d4403

View File

@@ -14,20 +14,19 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [windows-2019, macos-13, ubuntu-20.04] os: [windows-latest, macos-latest, ubuntu-latest]
arch: [aarch64, amd64]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install UPX - name: Install UPX
uses: crazy-max/ghaction-upx@v2 uses: crazy-max/ghaction-upx@v2
if: matrix.os == 'windows-2019' || matrix.os == 'ubuntu-20.04' if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
with: with:
install-only: true install-only: true
- name: UPX version - name: UPX version
if: matrix.os == 'windows-2019' || matrix.os == 'ubuntu-20.04' if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
run: upx --version run: upx --version
- name: Setup Python 3.10 - name: Setup Python 3.10
@@ -37,7 +36,6 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
echo $(uname -m)
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
pip install face_recognition --no-deps pip install face_recognition --no-deps
@@ -48,7 +46,7 @@ jobs:
python number_parser.py -v python number_parser.py -v
- name: Build with PyInstaller for macos/ubuntu - name: Build with PyInstaller for macos/ubuntu
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-20.04' if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: | run: |
pyinstaller \ pyinstaller \
--onefile Movie_Data_Capture.py \ --onefile Movie_Data_Capture.py \
@@ -62,7 +60,7 @@ jobs:
--add-data "config.ini:." \ --add-data "config.ini:." \
- name: Build with PyInstaller for windows - name: Build with PyInstaller for windows
if: matrix.os == 'windows-2019' if: matrix.os == 'windows-latest'
run: | run: |
pyinstaller ` pyinstaller `
--onefile Movie_Data_Capture.py ` --onefile Movie_Data_Capture.py `
@@ -80,23 +78,23 @@ jobs:
cp config.ini dist/ cp config.ini dist/
- name: Set VERSION variable for macos/ubuntu - name: Set VERSION variable for macos/ubuntu
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-20.04' if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: | run: |
echo "VERSION=$(python Movie_Data_Capture.py --version)" >> $GITHUB_ENV echo "VERSION=$(python Movie_Data_Capture.py --version)" >> $GITHUB_ENV
- name: Set VERSION variable for windows - name: Set VERSION variable for windows
if: matrix.os == 'windows-2019' if: matrix.os == 'windows-latest'
run: | run: |
echo "VERSION=$(python Movie_Data_Capture.py --version)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "VERSION=$(python Movie_Data_Capture.py --version)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload build artifact - name: Upload build artifact
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: MDC-${{ env.VERSION }}-${{ matrix.os }}-${{ matrix.arch }} name: MDC-${{ env.VERSION }}-${{ runner.os }}-amd64
path: dist path: dist
- name: Run test (Ubuntu & MacOS) - name: Run test (Ubuntu & MacOS)
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-13' if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: | run: |
cd dist cd dist
touch IPX-292.mp4 touch IPX-292.mp4