Skip to content

update/fix osc scripts #41

update/fix osc scripts

update/fix osc scripts #41

Workflow file for this run

name: release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
libmpv:
name: Build ${{ matrix.platform }} libmpv
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- platform: Win32
arch: i686
wine: wine32
- platform: x64
arch: x86_64
wine: wine64
env:
TARGET: ${{ matrix.arch }}-w64-mingw32
RUST_TARGET: ${{ matrix.arch }}-pc-windows-gnu
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive
- name: Install upstream build tools
run: |
rustup target add "$RUST_TARGET"
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install --no-install-recommends -y ccache g++-mingw-w64 gcc-multilib glslang-tools python3-pip nasm ninja-build pkgconf ${{ matrix.wine }} wine
python -m pip install meson
command -v glslangValidator
glslangValidator --version
printf '#version 460\n#pragma shader_stage(compute)\n#extension GL_KHR_shader_subgroup_basic : require\nlayout(local_size_x = 1) in;\nvoid main() { bool elected = subgroupElect(); }\n' > /tmp/foo-mpv-shader.comp.glsl
glslangValidator -V --target-env spirv1.6 --glsl-version 460 -o /tmp/foo-mpv-shader.spv /tmp/foo-mpv-shader.comp.glsl
- name: Install upstream Meson wraps
working-directory: mpv
run: |
mkdir -p subprojects
meson wrap install mujs
meson subprojects download
- name: Build with upstream MinGW recipe
working-directory: mpv
run: |
./ci/build-mingw64.sh
./ci/build-mingw64.sh meson pack
- name: Print mpv Meson log
if: failure()
working-directory: mpv
run: |
if [ -f mingw_build/meson-logs/meson-log.txt ]; then
tail -n 250 mingw_build/meson-logs/meson-log.txt
fi
- name: Collect and test libmpv
run: |
test -f mpv/mingw_build/libmpv-2.dll
cp mpv/mingw_build/libmpv-2.dll mpv/artifact/mpv-2.dll
"$TARGET-gcc-posix" -I mpv/include scripts/smoke-libmpv.c -o mpv/artifact/smoke-libmpv.exe
cd mpv/artifact
wine ./smoke-libmpv.exe ./mpv-2.dll
rm smoke-libmpv.exe
- name: Upload libmpv runtime
uses: actions/upload-artifact@v7
with:
name: libmpv-${{ matrix.platform }}
if-no-files-found: error
path: mpv/artifact/*.dll
component:
name: Build ${{ matrix.platform }} Windows component
runs-on: windows-2025-vs2026
strategy:
fail-fast: false
matrix:
include:
- platform: Win32
triplet: x86-mpv
- platform: x64
triplet: x64-mpv
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v3
with:
vs-version: '[18.0,19.0)'
msbuild-architecture: x64
- name: Configure vcpkg cache
uses: lukka/run-vcpkg@v11.6
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
- name: Install dependencies
shell: pwsh
run: .\scripts\install-dependencies.ps1 -Triplet '${{ matrix.triplet }}'
- name: Set release version
shell: pwsh
run: |
$version = $env:GITHUB_REF_NAME -replace '^v', '' -replace '-', ' '
$versionDefinition = '#define VERSION_NO "{0}"' -f $version
(Get-Content .\src\main.cpp) `
-replace '#define VERSION_NO.*$', $versionDefinition |
Set-Content .\src\main.cpp
- name: Build Release
run: >-
msbuild .\src\foo_mpv.sln /m /t:Build
/p:Configuration=Release /p:Platform=${{ matrix.platform }} /v:minimal
- name: Upload component binaries
uses: actions/upload-artifact@v7
with:
name: component-${{ matrix.platform }}
if-no-files-found: error
path: |
src/build/${{ matrix.platform }}/Release/foo_mpv/foo_mpv.dll
src/build/${{ matrix.platform }}/Release/foo_mpv/foo_mpv.pdb
release:
name: Package Windows component
runs-on: windows-2025-vs2026
needs: [libmpv, component]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Download Win32 component
uses: actions/download-artifact@v8
with:
name: component-Win32
path: artifacts/component/Win32
- name: Download x64 component
uses: actions/download-artifact@v8
with:
name: component-x64
path: artifacts/component/x64
- name: Download Win32 libmpv runtime
uses: actions/download-artifact@v8
with:
name: libmpv-Win32
path: artifacts/runtime/Win32
- name: Download x64 libmpv runtime
uses: actions/download-artifact@v8
with:
name: libmpv-x64
path: artifacts/runtime/x64
- name: Package component
shell: pwsh
run: |
.\scripts\package-component.ps1 `
-Win32Dll .\artifacts\component\Win32\foo_mpv.dll `
-X64Dll .\artifacts\component\x64\foo_mpv.dll `
-Win32Libmpv .\artifacts\runtime\Win32\mpv-2.dll `
-X64Libmpv .\artifacts\runtime\x64\mpv-2.dll
7z l .\artifacts\foo_mpv.fb2k-component
- name: Upload workflow artifacts
uses: actions/upload-artifact@v7
with:
name: foo_mpv-release
if-no-files-found: error
path: |
artifacts/foo_mpv.fb2k-component
artifacts/foo_mpv-symbols.zip
- name: Create draft release
if: github.ref_type == 'tag'
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$assets = @(
'.\artifacts\foo_mpv.fb2k-component',
'.\artifacts\foo_mpv-symbols.zip'
)
gh release view $env:GITHUB_REF_NAME *> $null
if ($LASTEXITCODE -eq 0) {
gh release upload $env:GITHUB_REF_NAME @assets --clobber
} else {
gh release create $env:GITHUB_REF_NAME @assets `
--draft --title $env:GITHUB_REF_NAME --notes 'Automated release'
}