Skip to content

Commit

Permalink
Fix the CI builds (#152)
Browse files Browse the repository at this point in the history
* Add obs-plugintemplate files (#1)

* Add obs-plugintemplate files

* Rename

* Update CMakeLists.txt

* Update main.yml

* files

* Update CMakeLists.txt

* Fix

* Update .Brewfile

* Update main.yml

* Update main.yml

* check-cmake.sh

* Update main.yml

* Update main.yml

* Build my opencv (#2)

* BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* check-cmake

* Update main.yml

* Update buildspec.json

* Update CMakeLists.txt

* Build my onnxruntime (#3)

* fix

* Update BuildMyOnnxruntime.cmake

* Enable arm64

* 0.5.2

* Update BuildMyOnnxruntime.cmake

* Update .Brewfile

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* fix

* Fix

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* a

* Create .gitmodules

* Create onnxruntime

* Update onnxruntime

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* fix

* Update BuildMyOnnxruntime.cmake

* ARCHITECTURE

* Apply

* Update BuildMyOnnxruntime.cmake

* fix

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* aaa

* Enable Windows build (#4)

* Enable Windows build

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Fix linkage

* Remove /WX

* Update ObsPluginHelpers.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update CMakeLists.txt

* Fix

* Update CMakeLists.txt

* a

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Disable DML

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update background-filter.cpp

* Update BuildMyOnnxruntime.cmake

* Disable DML

* Fix segfault (#6)

* Update Model.h

* 0.5.6

* Ccache macos (#8)

* Ccache

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Revert "Update BuildMyOnnxruntime.cmake"

This reverts commit 44d9caa.

* Revert "Update BuildMyOnnxruntime.cmake"

This reverts commit 9294106.

* Direct ml (#7)

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update CMakeLists.txt

* Update CMakeLists.txt

* Update CMakeLists.txt

* dml

* 0.5.7

* Update CMakeLists.txt

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* a

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Fix

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Linux build (#9)

* linux

* 0.5.8

* Update BuildMyOnnxruntime.cmake

* Update setup_ccache (#10)

* bump version (#11)

* Use ninja on windows (#12)

* Update main.yml

* Update main.yml

* Use Ninja

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* ccache

* Update BuildMyOpenCV.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Update main.yml

* Update CMakeLists.txt

* Update BuildMyOnnxruntime.cmake

* Long path

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Windows opencv ccache (#13)

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update main.yml

* Update BuildMyOpenCV.cmake

* bump 0.5.10 (#14)

* Cleanup (#15)

* Cleanup

* bump version

* Fix ep (#16)

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOpenCV.cmake

* Update main.yml (#18)

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* 0.5.12

* Fix

* Update package-macos.zsh

* Update package-linux.zsh

* Update CMakeLists.txt

* ci

* Fix

* Update background-filter.cpp

* Fix

* clang-format

* cmake-format

* Update BuildMyOpenCV.cmake

* Update BuildMyOnnxruntime.cmake

* Fix errors

* Use -isystem

* Use list in set_target_properties

* INTERFACE_INCLUDE_DIRECTORIES must be on IMPORTED TARGET

* Update ObsPluginHelpers.cmake
  • Loading branch information
umireon authored Mar 7, 2023
1 parent 39b1936 commit 664bf94
Show file tree
Hide file tree
Showing 11 changed files with 639 additions and 129 deletions.
1 change: 0 additions & 1 deletion .github/scripts/.Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ brew "cmake"
brew "git"
brew "jq"
brew "ninja"
brew "protobuf"
1 change: 1 addition & 0 deletions .github/scripts/utils.zsh/setup_ccache
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
autoload -Uz log_debug log_warning

hash -r
if (( ${+commands[ccache]} )) {
log_debug "Found ccache at ${commands[ccache]}"

Expand Down
221 changes: 212 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: true
matrix:
arch: [x86_64] # arm64, universal
arch: [x86_64, arm64]
if: always()
needs: [clang_check]
outputs:
Expand Down Expand Up @@ -151,11 +151,122 @@ jobs:
codesign: 'true'
codesignIdent: ${{ env.CODESIGN_IDENT }}

- name: Package Plugin
- name: Archive Artifact
working-directory: ${{ github.workspace }}/plugin/release/
run: tar -cf ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}.tar.gz ${{ env.PLUGIN_NAME }}.plugin

- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: |
${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}.tar.gz
${{ github.workspace }}/plugin/build_${{ matrix.arch }}/installer-macos.generated.pkgproj
macos_package:
name: 02 - macOS (package)
runs-on: macos-12
needs: [macos_build]
outputs:
commitHash: ${{ steps.setup.outputs.commitHash }}
env:
CODESIGN_IDENT: '-'
CODESIGN_IDENT_INSTALLER: ''
MACOSX_DEPLOYMENT_TARGET: '10.15'
defaults:
run:
shell: zsh {0}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: plugin
submodules: recursive

- name: Setup Environment
id: setup
working-directory: ${{ github.workspace }}/plugin
run: |
## SETUP ENVIRONMENT SCRIPT
print '::group::Clean Homebrew Environment'
typeset -a to_remove=()
for formula (speexdsp curl php) {
if [[ -d ${HOMEBREW_PREFIX}/opt/${formula} ]] to_remove+=(${formula})
}
if (( #to_remove > 0 )) brew uninstall --ignore-dependencies ${to_remove}
print '::endgroup::'
print '::group::Set up code signing'
if [[ '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
'${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
'${{ secrets.MACOS_SIGNING_CERT }}' != '' ]] {
print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT
} else {
print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
}
if [[ '${{ secrets.MACOS_NOTARIZATION_USERNAME }}' != '' && \
'${{ secrets.MACOS_NOTARIZATION_PASSWORD }}' != '' ]] {
print 'haveNotarizationUser=true' >> $GITHUB_OUTPUT
} else {
print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT
}
print '::endgroup::'
print "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
print "commitHash=${"$(git rev-parse HEAD)"[0,9]}" >> $GITHUB_OUTPUT
- name: Check for GitHub Labels
id: seekingTesters
if: ${{ github.event_name == 'pull_request' }}
run: |
if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]] {
print 'found=true' >> $GITHUB_OUTPUT
} else {
print 'found=false' >> $GITHUB_OUTPUT
}
- name: Install Apple Developer Certificate
if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
with:
keychain-password: ${{ github.run_id }}
p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}

- name: Set Signing Identity
if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
run: |
print "CODESIGN_IDENT=${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}" >> $GITHUB_ENV
print "CODESIGN_IDENT_INSTALLER=${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}" >> $GITHUB_ENV
- name: Download x86_64 build artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-macos-x86_64-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin

- name: Extract x86_64 build artifact
working-directory: ${{ github.workspace }}/plugin/release
run: tar -xzf ${{ env.PLUGIN_NAME }}-macos-x86_64.tar.gz

- working-directory: ${{ github.workspace }}/plugin
run: |
mkdir -p build_arm64 build_universal
- name: Place pkgproj
working-directory: ${{ github.workspace }}/plugin
run: |
cp build_x86_64/installer-macos.generated.pkgproj build_arm64/
cp build_x86_64/installer-macos.generated.pkgproj build_universal/
- name: Package x86_64 Plugin
uses: ./plugin/.github/actions/package-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
target: x86_64
config: RelWithDebInfo
codesign: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
notarize: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && steps.setup.outputs.haveNotarizationUser == 'true' }}
Expand All @@ -164,12 +275,63 @@ jobs:
codesignUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}

- name: Upload Build Artifact
- name: Extract x86_64 bundle
working-directory: ${{ github.workspace }}/plugin
run: mv release/${{ env.PLUGIN_NAME }}.plugin/Contents/MacOS/${{ env.PLUGIN_NAME }} release/${{ env.PLUGIN_NAME }}-x86_64

- name: Remove x86_64 build artifact
run: rm -rf ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}.plugin

- name: Download ARM64 build artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-macos-arm64-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin

- name: Extract ARM64 build artifact
working-directory: ${{ github.workspace }}/plugin/release
run: tar -xzf ${{ env.PLUGIN_NAME }}-macos-arm64.tar.gz

- name: Package ARM64 Plugin
uses: ./plugin/.github/actions/package-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: arm64
config: RelWithDebInfo
codesign: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
notarize: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && steps.setup.outputs.haveNotarizationUser == 'true' }}
codesignIdent: ${{ env.CODESIGN_IDENT }}
installerIdent: ${{ env.CODESIGN_IDENT_INSTALLER }}
codesignUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}

- name: Extract arm64 bundle
working-directory: ${{ github.workspace }}/plugin
run: mv release/${{ env.PLUGIN_NAME }}.plugin/Contents/MacOS/${{ env.PLUGIN_NAME }} release/${{ env.PLUGIN_NAME }}-arm64

- name: Create universal bundle
working-directory: ${{ github.workspace }}/plugin/release
run: lipo -create ${{ env.PLUGIN_NAME }}-x86_64 ${{ env.PLUGIN_NAME }}-arm64 -output ${{ env.PLUGIN_NAME }}.plugin/Contents/MacOS/${{ env.PLUGIN_NAME }}

- name: Package Universal Plugin
uses: ./plugin/.github/actions/package-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: universal
config: RelWithDebInfo
codesign: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
notarize: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && steps.setup.outputs.haveNotarizationUser == 'true' }}
codesignIdent: ${{ env.CODESIGN_IDENT }}
installerIdent: ${{ env.CODESIGN_IDENT_INSTALLER }}
codesignUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}

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

linux_build:
name: 02 - Linux
Expand All @@ -178,7 +340,7 @@ jobs:
fail-fast: true
matrix:
arch: [x86_64]
if: false # always()
if: always()
needs: [clang_check]
outputs:
commitHash: ${{ steps.setup.outputs.commitHash }}
Expand Down Expand Up @@ -256,20 +418,48 @@ jobs:
fail-fast: true
matrix:
arch: [x64]
if: false # always()
if: always()
needs: [clang_check]
outputs:
commitHash: ${{ steps.setup.outputs.commitHash }}
defaults:
run:
shell: pwsh
steps:
- name: Support longpaths
run: |
git config --system core.longpaths true
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- name: Checkout
uses: actions/checkout@v3
with:
path: plugin
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
architecture: "x64"

- name: Install ccache
run: |
Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.7.4/ccache-4.7.4-windows-x86_64.zip -OutFile ${{ github.workspace }}/ccache-4.7.4-windows-x86_64.zip
Expand-Archive -Path ccache-4.7.4-windows-x86_64.zip -DestinationPath ${{ github.workspace }}
"${{ github.workspace }}/ccache-4.7.4-windows-x86_64" >> $Env:GITHUB_PATH
- name: Setup ccache
run: |
ccache --version
ccache --set-config=cache_dir="${{ github.workspace }}/.ccache"
ccache --set-config=max_size="4096M"
ccache --set-config=compression=true
ccache -z
- uses: ilammy/msvc-dev-cmd@v1

- name: Checkout obs-studio
uses: actions/checkout@v3
with:
Expand All @@ -283,9 +473,20 @@ jobs:
id: setup
run: |
## SETUP ENVIRONMENT SCRIPT
$ccacheDate = Get-Date -Format "yyyy-MM-dd"
"ccacheDate=$ccacheDate" >> $env:GITHUB_OUTPUT
$CommitHash = (git rev-parse HEAD)[0..8] -join ''
"commitHash=${CommitHash}" >> $env:GITHUB_OUTPUT
- name: Restore Compilation Cache
id: ccache-cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.ccache
key: windows-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
restore-keys: |
windows-${{ matrix.arch }}-ccache-plugin-
- name: Check for GitHub Labels
id: seekingTesters
working-directory: ${{ github.workspace }}/plugin
Expand Down Expand Up @@ -349,10 +550,12 @@ 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_package, linux_build, windows_build]
defaults:
run:
shell: bash
permissions:
contents: write
steps:
- name: Get Metadata
id: metadata
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
*~
.DS_Store
/build/
/build32/
/build64/
/build_*/
/release/
/installer/Output/
build_x86_64
Expand All @@ -12,3 +11,4 @@ build_x86_64

# ignore generated files
*.generated.*
**/.Brewfile.lock.json
Loading

0 comments on commit 664bf94

Please sign in to comment.