Skip to content

Commit cbee3a1

Browse files
committed
refactor to my plugin structure
1 parent 9b40d37 commit cbee3a1

9 files changed

+1507
-389
lines changed

.github/FUNDING.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
github: Oncorporation
2-
patreon: Surn
3-
custom: ["https://www.paypal.me/CharlesFettinger", "https://live.blockcypher.com/ltc/address/MGo4THJBpy4y2k7hh6BoKiq6J5p641ygUC/","https://www.blockchain.com/btc/address/3HAN6eVxv81URgj51wxeCd9eMhg3tvriro","https://etherscan.io/address/0x79a67203CeA7c99b97c65D2982C8f35A4b968414"]
1+
github: exeldro
2+
custom: "https://www.paypal.me/exeldro"

.github/workflows/build.yml

+288
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
name: build obs plugin
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
PLUGIN_NAME: obs-shaderfilter
11+
12+
jobs:
13+
macos64:
14+
name: "macOS 64-bit"
15+
runs-on: [macos-latest]
16+
env:
17+
QT_VERSION: 5.14.1
18+
MACOS_DEPS_VERSION: '2020-08-30'
19+
steps:
20+
- name: Checkout
21+
uses: actions/[email protected]
22+
with:
23+
repository: obsproject/obs-studio
24+
submodules: 'recursive'
25+
- name: "Checkout plugin"
26+
uses: actions/[email protected]
27+
with:
28+
path: plugins/${{ env.PLUGIN_NAME }}
29+
- name: Fetch Git Tags
30+
run: |
31+
cd plugins/${{ env.PLUGIN_NAME }}
32+
git fetch --prune --tags --unshallow
33+
- name: 'Install prerequisites (Homebrew)'
34+
shell: bash
35+
run: |
36+
brew update --preinstall
37+
brew bundle --file ./CI/scripts/macos/Brewfile
38+
- name: 'Restore pre-built dependencies from cache'
39+
id: deps-cache
40+
uses: actions/[email protected]
41+
env:
42+
CACHE_NAME: 'deps-cache'
43+
with:
44+
path: /tmp/obsdeps
45+
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.MACOS_DEPS_VERSION }}
46+
- name: 'Restore pre-built Qt dependency from cache'
47+
id: deps-qt-cache
48+
uses: actions/[email protected]
49+
env:
50+
CACHE_NAME: 'deps-qt-cache'
51+
with:
52+
path: /tmp/obsdeps
53+
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.MACOS_DEPS_VERSION }}
54+
- name: 'Install prerequisite: Pre-built dependencies'
55+
if: steps.deps-cache.outputs.cache-hit != 'true'
56+
shell: bash
57+
run: |
58+
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/macos-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz
59+
tar -xf ./macos-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp"
60+
- name: 'Install prerequisite: Pre-built dependency Qt'
61+
if: steps.deps-qt-cache.outputs.cache-hit != 'true'
62+
shell: bash
63+
run: |
64+
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/macos-qt-${{ env.QT_VERSION }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz
65+
tar -xf ./macos-qt-${{ env.QT_VERSION }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp"
66+
xattr -r -d com.apple.quarantine /tmp/obsdeps
67+
- name: Configure
68+
shell: bash
69+
run: |
70+
echo "add_subdirectory(${{ env.PLUGIN_NAME }})" >> plugins/CMakeLists.txt
71+
mkdir ./build
72+
cd ./build
73+
cmake -DDISABLE_PYTHON=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DQTDIR="/tmp/obsdeps" -DSWIGDIR="/tmp/obsdeps" -DDepsPath="/tmp/obsdeps" ..
74+
cd -
75+
- name: Build
76+
shell: bash
77+
run: |
78+
set -e
79+
cd ./build
80+
make -j4
81+
cd -
82+
- name: 'Install prerequisite: Packages app'
83+
if: success()
84+
shell: bash
85+
run: |
86+
curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg
87+
sudo installer -pkg ./Packages.pkg -target /
88+
- name: Package
89+
if: success()
90+
shell: bash
91+
run: |
92+
cd plugins/${{ env.PLUGIN_NAME }}
93+
FILE_DATE=$(date +%Y-%m-%d)
94+
FILE_NAME=${{ env.PLUGIN_NAME }}-$FILE_DATE-${{ github.sha }}-macos.pkg
95+
echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV
96+
packagesbuild ./CI/macos/${{ env.PLUGIN_NAME }}.pkgproj
97+
cd -
98+
mkdir ./nightly
99+
mv plugins/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_NAME }}.pkg ./nightly/${FILE_NAME}
100+
- name: Publish
101+
if: success()
102+
uses: actions/[email protected]
103+
with:
104+
name: '${{ env.FILE_NAME }}'
105+
path: ./nightly/*.pkg
106+
ubuntu64:
107+
name: 'Linux/Ubuntu 64-bit'
108+
runs-on: [ubuntu-latest]
109+
steps:
110+
- name: Checkout
111+
uses: actions/[email protected]
112+
with:
113+
repository: obsproject/obs-studio
114+
submodules: 'recursive'
115+
- name: "Checkout plugin"
116+
uses: actions/[email protected]
117+
with:
118+
path: plugins/${{ env.PLUGIN_NAME }}
119+
- name: Add plugin to obs cmake
120+
shell: bash
121+
run: echo "add_subdirectory(${{ env.PLUGIN_NAME }})" >> plugins/CMakeLists.txt
122+
- name: Fetch Git Tags
123+
run: git fetch --prune --tags --unshallow
124+
- name: Install prerequisites (Apt)
125+
shell: bash
126+
run: |
127+
sudo dpkg --add-architecture amd64
128+
sudo apt-get -qq update
129+
sudo apt-get install -y \
130+
build-essential \
131+
checkinstall \
132+
cmake \
133+
libasound2-dev \
134+
libavcodec-dev \
135+
libavdevice-dev \
136+
libavfilter-dev \
137+
libavformat-dev \
138+
libavutil-dev \
139+
libcurl4-openssl-dev \
140+
libfdk-aac-dev \
141+
libfontconfig-dev \
142+
libfreetype6-dev \
143+
libgl1-mesa-dev \
144+
libjack-jackd2-dev \
145+
libjansson-dev \
146+
libluajit-5.1-dev \
147+
libpulse-dev \
148+
libqt5x11extras5-dev \
149+
libspeexdsp-dev \
150+
libswresample-dev \
151+
libswscale-dev \
152+
libudev-dev \
153+
libv4l-dev \
154+
libva-dev \
155+
libvlc-dev \
156+
libx11-dev \
157+
libx264-dev \
158+
libxcb-randr0-dev \
159+
libxcb-shm0-dev \
160+
libxcb-xinerama0-dev \
161+
libxcomposite-dev \
162+
libxinerama-dev \
163+
libmbedtls-dev \
164+
pkg-config \
165+
python3-dev \
166+
qtbase5-dev \
167+
libqt5svg5-dev \
168+
swig
169+
- name: 'Configure'
170+
shell: bash
171+
run: |
172+
mkdir ./build
173+
cd ./build
174+
cmake -DUNIX_STRUCTURE=0 -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/obs-studio-portable" -DBUILD_CAPTIONS=OFF -DWITH_RTMPS=OFF -DBUILD_BROWSER=OFF ..
175+
- name: 'Build'
176+
shell: bash
177+
working-directory: ${{ github.workspace }}/build
178+
run: make -j4
179+
- name: 'Package'
180+
shell: bash
181+
run: |
182+
FILE_DATE=$(date +%Y-%m-%d)
183+
FILE_NAME=${{ env.PLUGIN_NAME }}-$FILE_DATE-${{ github.sha }}-linux64.tar.gz
184+
echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV
185+
mkdir -p ./${{ env.PLUGIN_NAME }}/bin/64bit/
186+
mv ./build/plugins/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_NAME }}.so ./${{ env.PLUGIN_NAME }}/bin/64bit/${{ env.PLUGIN_NAME }}.so
187+
mv ./plugins/${{ env.PLUGIN_NAME }}/data ./${{ env.PLUGIN_NAME }}/data
188+
tar -cvzf "${FILE_NAME}" ${{ env.PLUGIN_NAME }}
189+
- name: 'Publish'
190+
uses: actions/[email protected]
191+
with:
192+
name: '${{ env.FILE_NAME }}'
193+
path: '*.tar.gz'
194+
windows:
195+
name: Windows
196+
runs-on: [windows-latest]
197+
env:
198+
QT_VERSION: 5.10.1
199+
CMAKE_GENERATOR: "Visual Studio 16 2019"
200+
CMAKE_SYSTEM_VERSION: "10.0.18363.657"
201+
WINDOWS_DEPS_VERSION: '2017'
202+
steps:
203+
- name: Add msbuild to PATH
204+
uses: microsoft/[email protected]
205+
- name: Checkout obs
206+
uses: actions/[email protected]
207+
with:
208+
repository: obsproject/obs-studio
209+
submodules: 'recursive'
210+
- name: Checkout plugin
211+
uses: actions/[email protected]
212+
with:
213+
path: plugins/${{ env.PLUGIN_NAME}}
214+
- name: Add plugin to obs cmake
215+
shell: cmd
216+
run: echo add_subdirectory(${{ env.PLUGIN_NAME }}) >> plugins/CMakeLists.txt
217+
- name: Fetch Git Tags
218+
run: git fetch --prune --tags --unshallow
219+
- name: 'Restore QT dependency from cache'
220+
id: qt-cache
221+
uses: actions/[email protected]
222+
env:
223+
CACHE_NAME: 'qt-cache'
224+
with:
225+
path: ${{ github.workspace }}/cmbuild/QT
226+
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.QT_VERSION }}
227+
- name: 'Restore pre-built dependencies from cache'
228+
id: deps-cache
229+
uses: actions/[email protected]
230+
env:
231+
CACHE_NAME: 'deps-cache'
232+
with:
233+
path: ${{ github.workspace }}/cmbuild/deps
234+
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.WINDOWS_DEPS_VERSION }}
235+
- name: 'Install prerequisite: QT'
236+
if: steps.qt-cache.outputs.cache-hit != 'true'
237+
run: |
238+
curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C -
239+
7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}/cmbuild/QT"
240+
- name: 'Install prerequisite: Pre-built dependencies'
241+
if: steps.deps-cache.outputs.cache-hit != 'true'
242+
run: |
243+
curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C -
244+
7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}/cmbuild/deps"
245+
- name: Configure
246+
run: |
247+
mkdir ./package
248+
mkdir ./build32
249+
cd ./build32
250+
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"Win32" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win32" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2017" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE ..
251+
cd ..
252+
mkdir ./build64
253+
cd ./build64
254+
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"x64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win64" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2017_64" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE ..
255+
- name: Build
256+
run: |
257+
msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-studio.sln
258+
msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-studio.sln
259+
- name: Package
260+
if: success()
261+
run: |
262+
$env:FILE_DATE=(Get-Date -UFormat "%F")
263+
$env:FILE_NAME="${{ env.PLUGIN_NAME }}-${env:FILE_DATE}-${{ github.sha }}-windows"
264+
echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV}
265+
robocopy .\build32\rundir\RelWithDebInfo\obs-plugins\32bit\ .\package\obs-plugins\32bit ${{ env.PLUGIN_NAME }}.* /E /XF .gitignore
266+
robocopy .\build64\rundir\RelWithDebInfo\obs-plugins\64bit\ .\package\obs-plugins\64bit ${{ env.PLUGIN_NAME }}.* /E /XF .gitignore
267+
robocopy .\build64\rundir\RelWithDebInfo\data\obs-plugins\${{ env.PLUGIN_NAME }}\ .\package\data\obs-plugins\${{ env.PLUGIN_NAME }}\ /E /XF .gitignore
268+
exit 0
269+
- name: Publish zip
270+
if: success()
271+
uses: actions/[email protected]
272+
with:
273+
name: '${{ env.FILE_NAME }}'
274+
path: package/*
275+
- name: "Package Installer (Prereqs)"
276+
run: |
277+
curl "-kL" "https://github.com/Xaymar/msvc-redist-helper/releases/download/0.1/msvc-redist-helper-64.exe" "-f" "--retry" "5" "-o" "msvc-redist-helper.exe"
278+
curl "-kL" "https://files.jrsoftware.org/is/6/innosetup-6.0.3.exe" "-f" "--retry" "5" "-o" "inno.exe"
279+
.\inno.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
280+
- name: "Package Installer (Compile)"
281+
run: |
282+
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\build64\plugins\${{ env.PLUGIN_NAME }}\installer.iss"
283+
- name: Publish installer
284+
if: success()
285+
uses: actions/[email protected]
286+
with:
287+
name: '${{ env.FILE_NAME }}-installer'
288+
path: package/*.exe

0 commit comments

Comments
 (0)