Skip to content

[VIDEO-3330] Drop use of setup-gstreamer GHA #157

[VIDEO-3330] Drop use of setup-gstreamer GHA

[VIDEO-3330] Drop use of setup-gstreamer GHA #157

Workflow file for this run

name: Laerdal Labs, DC GStreamer Plugin Windows Build
on:
push:
branches: [ master ]
release:
types: [released]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build-package:
name: Build Windows Nuget Package
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install meson/ninja
run: pip install meson ninja
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.DEV_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_KEY_SECRET }}
aws-region: 'us-east-1'
- id: get-gstreamer
name: Get GStreamer
uses: blinemedical/cerbero/.github/actions/build-gstreamer-for-windows@1.24-lldc
with:
cerbero-ref: 1.24.8-lldc.2
cerbero-args: --clocktime --timestamps -v visualstudio,noasserts
s3-download-paths: ${{ vars.GSTREAMER_S3_DOWNLOAD_PATH }}
- name: Download GStreamer MSIs
id: download
shell: powershell
run: |
$runtimeResponse = Invoke-WebRequest -Uri "${{ steps.get-gstreamer.outputs.runtime-installer-url }}"
$develResponse = Invoke-WebRequest -Uri "${{ steps.get-gstreamer.outputs.devel-installer-url }}"
$runtimeFilePath = $runtimeResponse.headers['content-disposition'].Split('=')[1]
$develFilePath = $develResponse.headers['content-disposition'].Split('=')[1]
echo "runtime_msi_path=$runtimeFilePath | Out-File -FilePath $Env:GITHUB_OUTPUT -Append -Encoding utf8
echo "devel_msi_path=$runtimeFilePath | Out-File -FilePath $Env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Install GStreamer
id: install-gstreamer
shell: powershell
run: |
$GSTREAMER_INSTALL_DIR="$(( $pwd.Drive.Name )):\gstreamer"
$GSTREAMER_ROOT="$GSTREAMER_INSTALL_DIR\1.0\msvc_x86_64"
$GSTREAMER_BIN="$GSTREAMER_ROOT\bin"
echo "$GSTREAMER_BIN" | Out-File -FilePath $Env:GITHUB_PATH -Append -Encoding utf8
echo "PKG_CONFIG_PATH=$GSTREAMER_ROOT\lib\pkgconfig;$env:PKG_CONFIG_PATH" | Out-File -FilePath $Env:GITHUB_ENV -Append -Encoding utf8
$log = "gstreamer-install.log"
echo "Installing GStreamer Runtime"
$procMain = Start-Process "msiexec" "/passive /norestart /i `"${{ steps.download.outputs.runtime_msi_path }}`" ADDLOCAL=ALL INSTALLDIR=`"$GSTREAMER_INSTALL_DIR`" /qn /l*! `"$log`"" -NoNewWindow -PassThru
$procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru
$procMain.WaitForExit()
$procLog.Kill()
echo "Installing GStreamer Development"
$procMain = Start-Process "msiexec" "/passive /norestart /i `"${{ steps.download.outputs.runtime_devel_path }}`" ADDLOCAL=ALL INSTALLDIR=`"$GSTREAMER_INSTALL_DIR`" /qn /l*! `"$log`"" -NoNewWindow -PassThru
$procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru
$procMain.WaitForExit()
$procLog.Kill()
tree /F "$GSTREAMER_INSTALL_DIR"
Get-ChildItem -Path "$(( $pwd.Drive.Name )):\" -Recurse | Where-Object { $_.Name -like "*pkg-config*" }
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install AWS C++ SDK
run: |
vcpkg install --binarysource="clear;x-gha,readwrite" --triplet x64-windows
echo "CMAKE_PREFIX_PATH=$PWD\vcpkg_installed\x64-windows" | Out-File -FilePath $Env:GITHUB_ENV -Append -Encoding utf8
- name: Build Amazon-S3 Plugin
id: build_plugin
run: |
# Debug build
meson setup --vsenv --buildtype debug build-debug
meson compile -C build-debug
# Release build
meson setup --vsenv --buildtype debugoptimized build
echo "plugin_version=$((meson introspect --projectinfo build | ConvertFrom-Json).version)" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append -Encoding utf8
meson compile -C build
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Generate NuGet packages
run: |
mkdir nupkgs
$version = "${{ steps.build_plugin.outputs.plugin_version }}"
if ("${{ (startsWith(github.ref, 'refs/tags/v') || ( github.event_name == 'release' && github.event.action == 'released' )) }}" -ne "true") {
$version += "-dev.${{ github.run_number }}"
}
$version += "+g${{ github.sha }}".Substring(0, 7)
nuget.exe pack Amazon-S3-Plugin.nuspec -Version $version -OutputDirectory nupkgs
- name: Upload NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: 'nupkgs/*.nupkg'
- name: Publish
run: |
Get-ChildItem ./nupkgs -filter "*.nupkg" | foreach{
dotnet nuget push $_.FullName --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/blinemedical/index.json
}