Skip to content

Commit

Permalink
[更新GitHub Actions工作流和vcpkg配置文件]: 根据项目需求,对GitHub Actions工作流和vcpkg配置文件进…
Browse files Browse the repository at this point in the history
…行了重要更新。

- 更新了`cmake.yml`和`qmake.yml`工作流文件,添加了对`vcpkg.json`文件的路径忽略规则,以确保更改此文件时不会触发不必要的工作流运行。
- 在`cmake.yml`和`qmake.yml`工作流中,为`vcpkg`安装步骤添加了新的库`breakpad`和`ffmpeg`的特定功能选项,以支持更广泛的功能需求。
- 更新了`cmake.yml`、`qmake.yml`和`toolchain.yml`工作流文件中的`vcpkg`安装命令,使用新的变量`matrix.vcpkg_libs`和`matrix.vcpkg_ffmpeg_features`,以实现更灵活的配置。
- 在`cmake.yml`工作流中,添加了删除`vcpkg.json`文件的步骤,以解决由于`jurplel/install-qt-action@v3`修改默认Python版本导致的问题。
- 更新了`readme.yml`工作流,将Node.js版本从`12.x`升级到`20.x`,以支持最新的Node.js特性和安全性更新。
- 在`toolchain.yml`工作流中,移除了`Install Qt`步骤,因为它与项目当前的需求不再相关。
- 创建了新的`vcpkg.json`文件,定义了项目的依赖项,包括`breakpad`和带有多个平台特定功能的`ffmpeg`,以及为不同平台配置的基线版本。
- 对于所有工作流,更新了`actions/cache/restore`和`actions/cache/save`操作到最新版本,以确保最佳性能和兼容性。
  • Loading branch information
RealChuan committed May 29, 2024
1 parent fd8611d commit bce5bcd
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 27 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'vcpkg.json'
pull_request:
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
- '.github/workflows/clean_cache.yml'
Expand All @@ -26,6 +27,7 @@ on:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'vcpkg.json'

jobs:
build:
Expand All @@ -44,17 +46,21 @@ jobs:
- "RelWithDebInfo"
generators:
- "Ninja"
vcpkg_libs:
- breakpad
vcpkg_ffmpeg_features:
- opengl,ass,bzip2,freetype,fribidi,zlib,gpl,ffmpeg,ffplay,ffprobe

steps:
- name: Restore windows vcpkg
if: startsWith(matrix.os, 'windows')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
- name: Restore macos or ubuntu vcpkg
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: /usr/local/share/vcpkg/installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
Expand All @@ -66,7 +72,7 @@ jobs:
choco install ninja
ninja --version
cmake --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-windows
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec,qsv] --triplet x64-windows
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
shell: bash
Expand All @@ -75,17 +81,18 @@ jobs:
ninja --version
cmake --version
clang --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-osx
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }}] --triplet x64-osx
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt-get update
sudo apt-get install ninja-build nasm build-essential libgl1-mesa-dev
sudo apt-get install ninja-build nasm autopoint gperf libgl1-mesa-dev \
libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev
ninja --version
cmake --version
gcc --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-linux
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec] --triplet x64-linux
- name: Install Qt
uses: jurplel/install-qt-action@v3
Expand All @@ -99,6 +106,13 @@ jobs:
with:
fetch-depth: 1

# jurplel/install-qt-action@v3, 这个action会修改默认的python版本,
# 会导致部分使用vcpkg的库编译失败,比如libsystemd,所以需要删除vcpkg.json
- name: Delete vcpkg.json
shell: bash
run: |
rm vcpkg.json
- name: Enable Developer Command Prompt
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.12.1
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/qmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'vcpkg.json'
pull_request:
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
- '.github/workflows/clean_cache.yml'
Expand All @@ -26,6 +27,7 @@ on:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'vcpkg.json'

jobs:
build:
Expand All @@ -40,17 +42,21 @@ jobs:
- ubuntu-latest
qt_ver:
- 6.6.2
vcpkg_libs:
- breakpad
vcpkg_ffmpeg_features:
- opengl,ass,bzip2,freetype,fribidi,zlib,gpl,ffmpeg,ffplay,ffprobe

steps:
- name: Restore windows vcpkg
if: startsWith(matrix.os, 'windows')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
- name: Restore macos or ubuntu vcpkg
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: /usr/local/share/vcpkg/installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
Expand All @@ -62,7 +68,7 @@ jobs:
choco install ninja
ninja --version
cmake --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-windows
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec,qsv] --triplet x64-windows
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
shell: bash
Expand All @@ -71,17 +77,18 @@ jobs:
ninja --version
cmake --version
clang --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-osx
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }}] --triplet x64-osx
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt-get update
sudo apt-get install ninja-build nasm build-essential libgl1-mesa-dev
sudo apt-get install ninja-build nasm autopoint gperf libgl1-mesa-dev \
libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev
ninja --version
cmake --version
gcc --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-linux
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec] --triplet x64-linux
- name: Install Qt
uses: jurplel/install-qt-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 12.x
node-version: 20.x
# ISO Langusge Codes: https://cloud.google.com/translate/docs/languages
- name: Adding README - English
uses: dephraiim/translate-readme@main
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,20 @@ jobs:
- ubuntu-latest
qt_ver:
- 6.6.2
vcpkg_libs:
- breakpad
vcpkg_ffmpeg_features:
- opengl,ass,bzip2,freetype,fribidi,zlib,gpl,ffmpeg,ffplay,ffprobe

steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
install-deps: 'true'
modules: 'qt5compat qtnetworkauth qtmultimedia qtimageformats'
cache: 'true'

- name: Install dependencies on windows
if: startsWith(matrix.os, 'windows')
shell: bash
run: |
choco install ninja
ninja --version
cmake --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-windows
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec,qsv] --triplet x64-windows
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
shell: bash
Expand All @@ -48,28 +44,36 @@ jobs:
ninja --version
cmake --version
clang --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-osx
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }}] --triplet x64-osx
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt-get update
sudo apt-get install ninja-build nasm build-essential libgl1-mesa-dev
sudo apt-get install ninja-build nasm autopoint gperf libgl1-mesa-dev \
libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev
ninja --version
cmake --version
gcc --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-linux
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec] --triplet x64-linux
- name: cache windows vcpkg
if: startsWith(matrix.os, 'windows')
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
- name: cache macos or ubuntu vcpkg
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: /usr/local/share/vcpkg/installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
install-deps: 'true'
modules: 'qt5compat qtnetworkauth qtmultimedia qtimageformats'
cache: 'true'
37 changes: 37 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "qt-ffmpeg",
"version": "0.0.1",
"description": "manifest",
"dependencies": [
"breakpad",
{
"name": "ffmpeg",
"features": [
"opengl",
"ass",
"bzip2",
"freetype",
"fribidi",
"zlib",
"gpl",
"ffmpeg",
"ffplay",
"ffprobe",
{
"name": "qsv",
"platform": "windows"
},
{
"name": "amf",
"platform": "windows | linux"
},
{
"name": "nvcodec",
"platform": "windows | linux"
}
]
}
],
"builtin-baseline": "3c76dc55f8bd2b7f4824bcd860055094bfbbb9ea"
}

0 comments on commit bce5bcd

Please sign in to comment.