Skip to content

Commit

Permalink
Linux build (#9)
Browse files Browse the repository at this point in the history
* linux

* 0.5.8

* Update BuildMyOnnxruntime.cmake
  • Loading branch information
umireon authored Jan 28, 2023
1 parent edfd1c6 commit 1d03574
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 81 deletions.
157 changes: 78 additions & 79 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,83 +173,83 @@ jobs:
name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-macos-${{ matrix.arch }}.pkg

# linux_build:
# name: 02 - Linux
# runs-on: ubuntu-22.04
# strategy:
# fail-fast: true
# matrix:
# arch: [x86_64]
# if: always()
# needs: [clang_check]
# outputs:
# commitHash: ${{ steps.setup.outputs.commitHash }}
# defaults:
# run:
# shell: bash
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# path: plugin
# submodules: recursive

# - name: Checkout obs-studio
# uses: actions/checkout@v3
# with:
# repository: 'obsproject/obs-studio'
# path: obs-studio
# fetch-depth: 0
# submodules: recursive

# - name: Setup Environment
# working-directory: ${{ github.workspace }}/plugin
# id: setup
# run: |
# ## SETUP ENVIRONMENT SCRIPT
# echo "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
# echo "commitHash=$(git rev-parse HEAD | cut -c1-9)" >> $GITHUB_OUTPUT

# - name: Restore Compilation Cache
# id: ccache-cache
# uses: actions/cache@v3
# with:
# path: ${{ github.workspace }}/.ccache
# key: linux-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
# restore-keys: |
# linux-${{ matrix.arch }}-ccache-plugin-

# - name: Check for GitHub Labels
# id: seekingTesters
# if: ${{ github.event_name == 'pull_request' }}
# run: |
# ## GITHUB LABEL SCRIPT
# if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]]; then
# echo 'found=true' >> $GITHUB_OUTPUT
# else
# echo 'found=false' >> $GITHUB_OUTPUT
# fi

# - name: Build Plugin
# uses: ./plugin/.github/actions/build-plugin
# with:
# workingDirectory: ${{ github.workspace }}/plugin
# target: ${{ matrix.arch }}
# config: RelWithDebInfo

# - name: Package Plugin
# uses: ./plugin/.github/actions/package-plugin
# with:
# workingDirectory: ${{ github.workspace }}/plugin
# target: ${{ matrix.arch }}
# config: RelWithDebInfo

# - name: Upload Build Artifact
# if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.PLUGIN_NAME }}-linux-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
# path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-linux-${{ matrix.arch }}.*
linux_build:
name: 02 - Linux
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
arch: [x86_64]
if: always()
needs: [clang_check]
outputs:
commitHash: ${{ steps.setup.outputs.commitHash }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: plugin
submodules: recursive

- name: Checkout obs-studio
uses: actions/checkout@v3
with:
repository: 'obsproject/obs-studio'
path: obs-studio
fetch-depth: 0
submodules: recursive

- name: Setup Environment
working-directory: ${{ github.workspace }}/plugin
id: setup
run: |
## SETUP ENVIRONMENT SCRIPT
echo "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
echo "commitHash=$(git rev-parse HEAD | cut -c1-9)" >> $GITHUB_OUTPUT
- name: Restore Compilation Cache
id: ccache-cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.ccache
key: linux-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
restore-keys: |
linux-${{ matrix.arch }}-ccache-plugin-
- name: Check for GitHub Labels
id: seekingTesters
if: ${{ github.event_name == 'pull_request' }}
run: |
## GITHUB LABEL SCRIPT
if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]]; then
echo 'found=true' >> $GITHUB_OUTPUT
else
echo 'found=false' >> $GITHUB_OUTPUT
fi
- name: Build Plugin
uses: ./plugin/.github/actions/build-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo

- name: Package Plugin
uses: ./plugin/.github/actions/package-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo

- name: Upload Build Artifact
if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-linux-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-linux-${{ matrix.arch }}.*

windows_build:
name: 02 - Windows
Expand Down Expand Up @@ -360,8 +360,7 @@ jobs:
name: 03 - Create and upload release
runs-on: ubuntu-22.04
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
# needs: [macos_build, linux_build, windows_build]
needs: [macos_build, windows_build]
needs: [macos_build, linux_build, windows_build]
defaults:
run:
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD 20)

# Change obs-plugintemplate to your plugin's name in a machine-readable format
# (e.g.: obs-myawesomeplugin) and set
project(obs-backgroundremoval VERSION 0.5.7)
project(obs-backgroundremoval VERSION 0.5.8)
add_library(${CMAKE_PROJECT_NAME} MODULE)

# Replace `Your Name Here` with the name (yours or your organization's) you want
Expand Down
2 changes: 1 addition & 1 deletion buildspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@
}
},
"name": "obs-backgroundremoval",
"version": "0.5.7"
"version": "0.5.8"
}
13 changes: 13 additions & 0 deletions cmake/BuildMyOnnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ elseif(OS_MACOS)
<BINARY_DIR>/${CMAKE_BUILD_TYPE}/external/nsync/${Onnxruntime_LIB_PREFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}nsync_cpp${CMAKE_STATIC_LIBRARY_SUFFIX}
)
set(Onnxruntime_PROTOBUF_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
else()
set(PYTHON3 python3)
set(Onnxruntime_PLATFORM_OPTIONS
--cmake_generator Ninja --cmake_extra_defines
CMAKE_C_COMPILER_LAUNCHER=ccache --cmake_extra_defines
CMAKE_CXX_COMPILER_LAUNCHER=ccache)
set(Onnxruntime_PLATFORM_BYPRODUCT
<INSTALL_DIR>/lib/${CMAKE_STATIC_LIBRARY_PREFIX}nsync_cpp${CMAKE_STATIC_LIBRARY_SUFFIX}
)
set(Onnxruntime_PLATFORM_INSTALL_FILES
<BINARY_DIR>/${CMAKE_BUILD_TYPE}/external/nsync/${Onnxruntime_LIB_PREFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}nsync_cpp${CMAKE_STATIC_LIBRARY_SUFFIX}
)
set(Onnxruntime_PROTOBUF_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
endif()

ExternalProject_Add(
Expand Down

0 comments on commit 1d03574

Please sign in to comment.