Skip to content

Commit

Permalink
CI : Linux build fix (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
xurei authored Oct 28, 2024
1 parent 40d9089 commit 6d84706
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/scripts/.build.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ ${_usage_host:-}"

if [[ ${host_os} == linux ]] {
autoload -Uz setup_linux && setup_linux

# Install OBS 31.0.0 from github if installed OBS is < 31
obs --version
obs_major_version=$(echo $(obs --version) | grep -oP '(?<=OBS Studio - )\d+')
if (( $obs_major_version < 31 )) {
log_info "Installed OBS is too old. Installing version 31.0.0.beta2 from github..."
curl -L -o obs-studio_31.0.0.beta2.deb https://github.com/obsproject/obs-studio/releases/download/31.0.0-beta2/obs-studio_31.0.0.beta2-0obsproject1.noble_amd64.deb
sudo dpkg --force-all -i obs-studio_31.0.0.beta2.deb
}
}

local product_name
Expand Down
3 changes: 2 additions & 1 deletion .github/scripts/utils.zsh/check_linux
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ for dependency (${dependencies}) {
binary=${tokens[2]}
}

if (( ! ${+commands[${binary}]} )) install_list+=(${tokens[2]})
local dep="${tokens[2]//[$'\t\r\n']}"
if (( ! ${+commands[${binary}]} )) install_list+=(${dep})
}

log_debug "List of dependencies to install: ${install_list}"
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/utils.zsh/setup_linux
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) {
sudo apt-get install ${apt_args} gcc-${${target##*-}//_/-}-linux-gnu g++-${${target##*-}//_/-}-linux-gnu
}

sudo add-apt-repository --yes ppa:obsproject/obs-studio
if [[ "${CI}" ]]; then
sudo add-apt-repository --yes ppa:obsproject/obs-studio
fi
sudo apt update

sudo apt-get install ${apt_args} \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ jobs:
- name: Upload Artifacts 📡
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*.*
name: obs-${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/obs-${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*.*

- name: Upload debug symbol artifacts 🪲
uses: actions/upload-artifact@v4
if: ${{ fromJSON(needs.check-event.outputs.package) }}
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*-dbgsym.ddeb
name: obs-${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym
path: ${{ github.workspace }}/release/obs-${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*-dbgsym.ddeb

windows-build:
name: Build for Windows 🪟
Expand Down
8 changes: 6 additions & 2 deletions cmake/linux/defaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ include(GNUInstallDirs)
# Enable find_package targets to become globally available targets
set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE)

set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_NAME "obs-${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${CMAKE_PROJECT_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_C_LIBRARY_ARCHITECTURE}")
set(CPACK_DEBIAN_PACKAGE_ENHANCES "obs-studio")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Plugin for OBS Studio to add Source Profiler to tools menu")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "This plugin adds a Source Profiler to tools menu. Based on the source profiling ui (https://github.com/derrod/obs-studio/tree/source-profiling-ui)")

set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.14), libgcc-s1 (>= 3.0), libstdc++6 (>= 5), obs-studio (>= 31.0.0~beta2)")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${PLUGIN_EMAIL}")
set(CPACK_SET_DESTDIR ON)

Expand Down

0 comments on commit 6d84706

Please sign in to comment.