Skip to content

Update c-cpp.yml

Update c-cpp.yml #101

Workflow file for this run

name: C/C++ CI
on: [push]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install deps
run: |
sudo apt-get update && sudo apt-get install -y meson ninja-build
- name: set deps version
run: |
echo "fc_ver=2.14.2" >> $GITHUB_ENV
echo "ft_ver=2.13.2" >> $GITHUB_ENV
echo "hb_ver=8.4.0" >> $GITHUB_ENV
echo "fb_ver=1.0.14" >> $GITHUB_ENV
echo "ass_ver=0.17.1" >> $GITHUB_ENV
- name: build fontconfig
run: |
wget https://www.freedesktop.org/software/fontconfig/release/fontconfig-${fc_ver}.tar.gz
tar -xzf fontconfig-${fc_ver}.tar.gz && rm fontconfig-${fc_ver}.tar.gz
cd fontconfig-${fc_ver}
meson --prefix="/usr" --default-library=static build
ninja -C build
sudo ninja -C build install
cd ..
rm -rf fontconfig-${fc_ver}
- name: build freetype
run: |
wget https://download.savannah.gnu.org/releases/freetype/freetype-${ft_ver}.tar.gz
tar -xzf freetype-${ft_ver}.tar.gz && rm freetype-${ft_ver}.tar.gz
cd freetype-${ft_ver}
./configure --prefix=/usr
meson --prefix="/usr" --default-library=static -Dharfbuzz=disabled -Dbrotli=disabled -Dpng=disabled build
meson compile -Cbuild
sudo meson install -Cbuild
cd ..
rm -rf freetype-${ft_ver}
- name: build harbuzz
run: |
wget https://github.com/harfbuzz/harfbuzz/archive/refs/tags/${hb_ver}.tar.gz
tar -xzf ${hb_ver}.tar.gz && rm ${hb_ver}.tar.gz
cd harfbuzz-${hb_ver}
meson --prefix="/usr" --default-library=static build
meson compile -Cbuild
sudo meson install -Cbuild
cd ..
rm -rf harfbuzz-${hb_ver}
- name: build fribidi
run: |
wget https://github.com/fribidi/fribidi/archive/refs/tags/v${fb_ver}.tar.gz
tar -xzf v${fb_ver}.tar.gz && rm v${fb_ver}.tar.gz
cd fribidi-${fb_ver}
meson --prefix="/usr" -Ddocs=false --backend=ninja --default-library=static build
ninja -C build
sudo ninja -C build install
cd ..
rm -rf fribidi-${fb_ver}
- name: build libass
run: |
wget https://github.com/libass/libass/archive/refs/tags/${ass_ver}.tar.gz
tar -xzf ${ass_ver}.tar.gz && rm ${ass_ver}.tar.gz
cd libass-${ass_ver}
./autogen.sh
CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/usr --disable-shared
make -j2
sudo make install
cd ..
rm -rf libass-${ass_ver}
- name: build
run: |
cmake -B build -S .
cmake --build build --clean-first
- name: set short version
shell: bash
run: |
ver_short=`git rev-parse --short HEAD`
echo "VERSION=$ver_short" >> $GITHUB_ENV
- name: upload
uses: actions/upload-artifact@v4
with:
name: assrender_linux-x64_${{ env.VERSION }}
path: build/src/libassrender.so
build-macos:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: install deps
run: |
brew install cmake libass
- name: build
run: |
cmake -B build -S .
cmake --build build --clean-first
build-mingw:
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
update: true
install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libass
msystem: MINGW64
path-type: inherit
- name: build
run: |
cmake -G "MSYS Makefiles" -B build -S .
cmake --build build --clean-first
build-win:
runs-on: windows-2019
strategy:
matrix:
include:
- target: 'x86'
platform: 'Win32'
- target: 'x64'
platform: 'x64'
steps:
- uses: actions/checkout@v4
- name: install submodules and nasm
shell: cmd
run: |
git submodule update --init --recursive --remote
git clone https://github.com/ShiftMediaProject/VSNASM.git --branch 0.9
.\VSNASM\install_script.bat
- name: force /MT build
shell: bash
run: |
sed -i -e 's|<ClCompile>|&<RuntimeLibrary>MultiThreaded</RuntimeLibrary>|g' SMP/*/SMP/*.vcxproj
sed -i -e 's|<ClCompile>|&<RuntimeLibrary>MultiThreaded</RuntimeLibrary>|g' assrender.vcxproj
- name: add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: build
run: MSBuild.exe /t:Rebuild /p:WindowsTargetPlatformVersion=10.0.19041.0 /p:PlatformToolset=v142 /m /p:Configuration=Release /p:Platform=${{matrix.target}}
- name: copy
run: cmake -E copy "bin\Release_${{matrix.platform}}\assrender.dll" dist\${{matrix.target}}\assrender.dll
- name: upload
uses: actions/upload-artifact@v2
with:
name: assrender_bin
path: dist