Skip to content

feat: do not ask to import video if already loaded #861

feat: do not ask to import video if already loaded

feat: do not ask to import video if already loaded #861

Workflow file for this run

# SPDX-FileCopyrightText: mpvQC developers
#
# SPDX-License-Identifier: MIT
name: Pipeline
on:
push:
branches:
- '**'
tags:
- '*'
defaults:
run:
shell: bash
env:
LIBMPV_URL: https://github.com/shinchiro/mpv-winbuild-cmake/releases/download/20251010/mpv-dev-x86_64-20251010-git-e70bb88.7z
LIBMPV_SHA256: c0b0206be071e856a220787fc15dcd692396952d37923d7d884b61a982715643
jobs:
matrix-build:
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
name: Build (${{ matrix.os }})
outputs:
artifact_app_name: ${{ steps.build_step.outputs.artifact_app_name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install just
uses: taiki-e/install-action@just
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: false
- name: Run Build
id: build_step
run: |
set -euo pipefail
function debug() { echo -e "\033[0;35m$*\033[0m"; }
function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
#
echo "::group::Download libmpv"
if [ "$RUNNER_OS" == "Linux" ]; then
execute sudo apt update -y
execute sudo apt install -y libegl1 libmpv2 qt6-base-dev
elif [ "$RUNNER_OS" == "Windows" ]; then
ARTIFACT="$(basename "$LIBMPV_URL")"
execute curl -L -O "$LIBMPV_URL"
echo -e "\033[0;34mecho -n $LIBMPV_SHA256 $ARTIFACT > $ARTIFACT.sha256\033[0m"
echo -n "$LIBMPV_SHA256 $ARTIFACT" > "$ARTIFACT.sha256"
execute sha256sum --check "$ARTIFACT.sha256"
execute 7z x "$ARTIFACT"
else
echo "$RUNNER_OS not supported"
exit 1
fi
echo "::endgroup::"
#
echo "::group::Remove Qml Test Files"
execute find . -type f -name 'tst_*' -delete
echo "::endgroup::"
#
echo "::group::Set Build Information"
PLACEHOLDER_TAG=">>>tag<<<"
PLACEHOLDER_COMMIT=">>>commit-id<<<"
CURRENT_TAG="$(git describe --tags --abbrev=0)"
debug "git tag: $CURRENT_TAG"
CURRENT_COMMIT="$(git rev-parse HEAD)"
CURRENT_COMMIT="${CURRENT_COMMIT:0:8}"
debug "git commit: $CURRENT_COMMIT"
ARTIFACT_NAME="mpvQC-$CURRENT_TAG-$CURRENT_COMMIT"
debug "artifact name: $ARTIFACT_NAME"
echo "artifact_app_name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT
execute sed -i "s/$PLACEHOLDER_TAG/$CURRENT_TAG/g" "mpvqc/startup.py"
execute sed -i "s/$PLACEHOLDER_COMMIT/$CURRENT_COMMIT/g" "mpvqc/startup.py"
execute cat "mpvqc/startup.py"
execute sed -i "s/$PLACEHOLDER_TAG/$CURRENT_TAG/g" "qt/qml/dialogs/MpvqcAboutDialog.qml"
execute sed -i "s/$PLACEHOLDER_COMMIT/$CURRENT_COMMIT/g" "qt/qml/dialogs/MpvqcAboutDialog.qml"
execute cat "qt/qml/dialogs/MpvqcAboutDialog.qml"
echo "::endgroup::"
#
echo "::group::Setup Virtual Environment"
execute just init
echo "::endgroup::"
#
echo "::group::Set Dependency Versions"
DEPENDENCY_MODEL_PATH="qt/qml/models/MpvqcLibraryModel.qml"
execute just insert-dependency-versions "$DEPENDENCY_MODEL_PATH"
execute cat "$DEPENDENCY_MODEL_PATH"
echo "::endgroup::"
#
echo "::group::Run Python Build"
execute just test-python
execute just clean
execute just build
echo "::endgroup::"
#
echo "::group::Remove __pycache__ Files"
execute find build/release -type d -name "__pycache__" -print0 | xargs -0 rm -rf
echo "::endgroup::"
#
RELEASE_NAME="release-build-${RUNNER_OS@L}"
echo "release_name=$RELEASE_NAME" >> $GITHUB_OUTPUT
debug "Uploading build/release as $RELEASE_NAME"
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
path: build/release
name: ${{ steps.build_step.outputs.release_name }}
build_windows:
runs-on: windows-latest
name: Build Windows
needs:
- matrix-build
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Install Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install just
uses: taiki-e/install-action@just
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: false
- name: Remove Python sources
run: |
function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
execute rm -rf mpvqc main.py
- name: Download Build Artifact
uses: actions/download-artifact@v5
with:
name: release-build-windows
path: .
- name: Setup Build Environment
run: |
function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
execute just init '--no-group dev'
execute uv pip install nuitka
- name: Build Bundle
run: |
function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
execute source .venv/Scripts/activate
echo "::group::Run Nuitka"
execute python.exe -m nuitka main.py \
--standalone \
--assume-yes-for-downloads \
--deployment \
--enable-plugin=pyside6 \
--output-dir=deployment \
--output-filename=mpvQC.exe \
--windows-console-mode=attach \
--windows-icon-from-ico=build-aux/icon.ico \
--include-qt-plugins=qml,platforms \
--noinclude-qt-plugins=designer,multimedia,sqldrivers,virtualkeyboard,styles \
--noinclude-qt-translations \
--include-data-files=LICENSES/*.txt=LICENSES/ \
--include-data-files=.venv/Lib/site-packages/PySide6/translations/qtbase*.qm=PySide6/translations/ \
--nofollow-import-to='PySide6.QtWidgets' \
--nofollow-import-to=tkinter,distutils,numpy.f2py \
--noinclude-data-files='PySide6/qml/QtQuick/Controls/designer/*' \
--noinclude-data-files='PySide6/qml/QtQuick/Controls/FluentWinUI3/*' \
--noinclude-data-files='PySide6/qml/QtQuick/Controls/Fusion/*' \
--noinclude-data-files='PySide6/qml/QtQuick/Controls/Imagine/*' \
--noinclude-data-files='PySide6/qml/QtQuick/Controls/Universal/*' \
--noinclude-data-files='PySide6/qml/QtQuick/Controls/Windows/*' \
--noinclude-data-files='PySide6/qml/QtQuick/VirtualKeyboard/*' \
--noinclude-data-files='PySide6/qml/QtTest/*' \
--noinclude-data-files='PySide6/qml/QtWebEngine/*' \
--noinclude-data-files='PySide6/qt-plugins/styles/*' \
--noinclude-dlls='PySide6/qml/QtQuick/Controls/FluentWinUI3/*' \
--noinclude-dlls='PySide6/qml/QtQuick/Controls/Fusion/*' \
--noinclude-dlls='PySide6/qml/QtQuick/Controls/Imagine/*' \
--noinclude-dlls='PySide6/qml/QtQuick/Controls/Universal/*' \
--noinclude-dlls='PySide6/qml/QtQuick/Controls/Windows/*' \
--noinclude-dlls='PySide6/qml/QtQuick/Controls/designer/*' \
--noinclude-dlls='PySide6/qml/QtQuick/VirtualKeyboard/*' \
--noinclude-dlls='PySide6/qml/QtTest/*' \
--noinclude-dlls='PySide6/qml/QtWebEngine/*' \
--noinclude-dlls='PySide6/qt-plugins/styles/*' \
--noinclude-dlls='Qt6Charts*' \
--noinclude-dlls='Qt6DataVisualization*' \
--noinclude-dlls='Qt6Pdf*' \
--noinclude-dlls='Qt6Quick3D*' \
--noinclude-dlls='Qt6Sensors*' \
--noinclude-dlls='Qt6Test*' \
--noinclude-dlls='Qt6WebEngine*' \
--noinclude-dlls='opengl32sw.dll' \
--noinclude-dlls='qt6designer.dll' \
--noinclude-dlls='qt6pdf.dll' \
--noinclude-dlls='qt6qmlcompiler.dll' \
--noinclude-dlls='qt6quickcontrols2fluentwinui3style*.dll' \
--noinclude-dlls='qt6quickcontrols2fusion*.dll' \
--noinclude-dlls='qt6quickcontrols2imagine*.dll' \
--noinclude-dlls='qt6quickcontrols2universal*.dll' \
--noinclude-dlls='qt6quickcontrols2windows*.dll' \
--noinclude-dlls='qt6quickparticles.dll' \
--noinclude-dlls='qt6widgets.dll' \
--output-filename=mpvQC.exe
echo "::endgroup::"
#
echo "::group::Package libmpv"
ARTIFACT="$(basename "$LIBMPV_URL")"
execute curl -L -O "$LIBMPV_URL"
echo -e "\033[0;34mecho -n $LIBMPV_SHA256 $ARTIFACT > $ARTIFACT.sha256\033[0m"
echo -n "$LIBMPV_SHA256 $ARTIFACT" > "$ARTIFACT.sha256"
execute sha256sum --check "$ARTIFACT.sha256"
execute 7z x "$ARTIFACT"
execute mv libmpv-2.dll deployment/main.dist
echo "::endgroup::"
#
echo "::group::Make Application Portable"
execute touch deployment/main.dist/portable
echo "::endgroup::"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ needs.matrix-build.outputs.artifact_app_name }}-win-x86_64
path: deployment/main.dist
test_qml:
runs-on: ubuntu-latest
name: Qml Tests
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Install Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install just
uses: taiki-e/install-action@just
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: false
- name: Update Packages
run: sudo apt update -y
- name: Install Dependencies
run: sudo apt install -y libegl1 libmpv2 qt6-base-dev
- name: Initialize Project
run: just init
- name: Execute Qml Tests
run: just test-qml
verify_formatting:
runs-on: ubuntu-latest
name: Linting & Formatting
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Install Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install just
uses: taiki-e/install-action@just
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: false
- name: Update Packages
run: sudo apt update -y
- name: Install Dependencies
run: sudo apt install -y qt6-base-dev
- name: Initialize Project
run: just init
- name: Run Linter and Formatter
run: just format
- name: Lint Qml
run: just lint-qml