-
Notifications
You must be signed in to change notification settings - Fork 71
432 lines (424 loc) · 21.6 KB
/
Copy pathmain.yml
File metadata and controls
432 lines (424 loc) · 21.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
name: "Multiplatform Plugin Build"
# MacOS build requires the following env secrets setup
#
# AC_USERNAME: Notarization Apple ID username
# AC_PASSWORD: App-specific notarization password
# AC_PROVIDER_SHORTNAME: Notarization account provider shortname.
# Can be found by running xcrun altool --list-providers -u $AC_USERNAME p- $AC_PASSWORD
# APPLICATION_CERTIFICATE: Base64 encoded Developer ID Application certificate from XCode
# APPLICATION_CERTIFICATE_PASSWORD: The password of the Application Certificate
# APPLICATION_CERTIFICATE_IDENTITY: The identity associated with the Application Certificate.
# Can be found by running security find-identity -v and copying the 40 character hex string associated with the certificate
# INSTALLER_CERTIFICATE: Base64 encoded Developer ID Installer certificate from XCode
# INSTALLER_CERTIFICATE_PASSWORD: The password of the Installer Certificate
# INSTALLER_CERTIFICATE_IDENTITY: The identity associated with the Installer Certificate.
# Can be found in the same way as APPLICATION_CERTIFICATE_IDENTITY
on:
push:
paths-ignore:
- "**.md"
branches:
- master
tags:
- "*"
pull_request:
paths-ignore:
- "docs/**"
- "**.md"
branches:
- master
jobs:
windows:
name: "Windows 32/64-bit"
environment: production
runs-on: [windows-2019]
if: contains(github.event.head_commit.message, '[skip ci]') != true
env:
QT_CACHE_VERSION: "2" # Change whenever updating OBS dependencies URL, in order to force a cache reset
QT_VERSION: "5.15.2"
VCPKG_CACHE_VERSION: "1"
WINDOWS_DEPS_CACHE_VERSION: "1" # Change whenever updating Qt dependency URL, in order to force a cache reset
WINDOWS_DEPS_VERSION: "2019"
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_SYSTEM_VERSION: "10.0"
steps:
- name: "Add msbuild to PATH"
uses: microsoft/setup-msbuild@v1.0.2
- name: "Checkout obs-ios-camera-source"
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-ios-camera-source
submodules: "recursive"
- name: "Checkout OBS-Studio"
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: "recursive"
- name: "Get OBS-Studio Git Info"
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: "Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})"
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: "Get obs-ios-camera-source Git Info"
shell: bash
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: |
git fetch --prune --unshallow
GIT_HASH=$(git rev-parse --short HEAD)
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
GIT_TAG=$(git describe --exact-match --tags --abbrev=0) || GIT_TAG=""
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV
if [ "$GIT_TAG" ] ; then \
VERSION="$GIT_TAG" \
VERSION_SUFFIX=$(echo "$GIT_TAG" | cut -c6-20) ; \
else \
VERSION="$GIT_HASH-git" \
VERSION_SUFFIX="-$GIT_HASH-git" ; \
fi
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
echo "CMAKE_VERSION_SUFFIX=$VERSION_SUFFIX" >> $GITHUB_ENV
- name: "Restore Cached Qt"
id: qtcache
uses: actions/cache@v2
with:
path: Qt_${{ env.QT_VERSION }}.7z
key: "qtdep-${{ env.QT_CACHE_VERSION }} | ${{ runner.os }}"
restore-keys: |
qtdep-${{ env.QT_CACHE_VERSION }} | ${{ runner.os }}
- name: "Download Prerequisite: Qt"
if: steps.qtcache.outputs.cache-hit != 'true'
run: |
curl -kLO https://tt2468.net/dl/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C -
- name: "Extract Prerequisite: Qt"
run: |
7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT"
- name: "Restore Cached Vcpkg dependencies"
id: vcpkgcache
uses: actions/cache@v2
with:
path: "C:/vcpkg/"
key: "vcpkgcachedeps-${{ env.VCPKG_CACHE_VERSION }} | ${{ runner.os }}"
restore-keys: |
vcpkgcachedeps-${{ env.VCPKG_CACHE_VERSION }} | ${{ runner.os }}
- name: "Install Camera Plugin Dependencies"
run: |
vcpkg integrate install
vcpkg install openssl:x86-windows-static
vcpkg install openssl:x64-windows-static
- name: "Restore Cached OBS-Studio Dependencies"
id: obscache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}\cmbuild\deps\**
key: "obsdep-${{ env.WINDOWS_DEPS_CACHE_VERSION }} | ${{ runner.os }}"
restore-keys: |
obsdep-${{ env.WINDOWS_DEPS_CACHE_VERSION }} | ${{ runner.os }}
- name: "Install Prerequisite: Pre-built OBS-Studio dependencies"
if: steps.obscache.outputs.cache-hit != 'true'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C -
7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}\cmbuild\deps"
- name: "Restore OBS-Studio 32-bit Build v${{ env.OBS_GIT_TAG }} from Cache"
id: build-cache-obs-32
uses: actions/cache@v2
env:
CACHE_NAME: "build-cache-obs-32"
with:
path: ${{ github.workspace }}/obs-studio/build32
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_NAME }}-
- name: "Configure OBS-Studio 32-bit"
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
if(!(Test-Path -Path ".\build32")){New-Item -ItemType directory -Path .\build32}
cd .\build32
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES -DBUILD_BROWSER=OFF ..
- name: "Build OBS-Studio 32-bit"
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
msbuild /m /p:Configuration=RelWithDebInfo .\build32\libobs\libobs.vcxproj
msbuild /m /p:Configuration=RelWithDebInfo .\build32\UI\obs-frontend-api\obs-frontend-api.vcxproj
- name: "Restore OBS-Studio 64-bit Build v${{ env.OBS_GIT_TAG }} from Cache"
id: build-cache-obs-64
uses: actions/cache@v1
env:
CACHE_NAME: "build-cache-obs-64"
with:
path: ${{ github.workspace }}/obs-studio/build64
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_NAME }}-
- name: "Configure OBS-Studio 64-bit"
if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
if(!(Test-Path -Path ".\build64")){New-Item -ItemType directory -Path .\build64}
cd .\build64
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES -DBUILD_BROWSER=OFF ..
- name: "Build OBS-Studio 64-bit"
if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
msbuild /m /p:Configuration=RelWithDebInfo .\build64\libobs\libobs.vcxproj
msbuild /m /p:Configuration=RelWithDebInfo .\build64\UI\obs-frontend-api\obs-frontend-api.vcxproj
- name: "Configure obs-ios-camera-source 32-bit"
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: |
mkdir .\build32
cd .\build32
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build32\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build32\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" -DCMAKE_TOOLCHAIN_FILE="c:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_DEFAULT_TRIPLET="86-windows-static" -DOPENSSL_ROOT_DIR="c:/vcpkg/installed/x86-windows-static" ..
- name: "Build obs-ios-camera-source 32-bit"
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-ios-camera-source.sln
- name: "Configure obs-ios-camera-source 64-bit"
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: |
mkdir .\build64
cd .\build64
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019_64" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build64\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build64\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" -DCMAKE_TOOLCHAIN_FILE="c:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_DEFAULT_TRIPLET="x64-windows-static" -DOPENSSL_ROOT_DIR="c:/vcpkg/installed/x64-windows-static" ..
- name: "Build obs-ios-camera-source 64-bit"
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-ios-camera-source.sln
- name: "Set PR Artifact Filename"
shell: bash
run: |
echo "WIN_FILENAME=obs-ios-camera-source-${{ env.PACKAGE_VERSION }}-Windows" >> $GITHUB_ENV
- name: "Package obs-ios-camera-source"
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: |
mkdir package
cd package
7z a "${{ env.WIN_FILENAME }}.zip" "..\release\*"
iscc ..\installer\installer.iss /O. /F"${{ env.WIN_FILENAME }}-Installer"
- name: "Publish ${{ env.WIN_FILENAME }}.zip"
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: "obs-ios-camera-source-${{ env.PACKAGE_VERSION }}-Windows"
path: ${{ github.workspace }}/obs-ios-camera-source/package/*.zip
- name: "Publish ${{ env.WIN_FILENAME }}-Installer.exe"
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: "obs-ios-camera-source-${{ env.PACKAGE_VERSION }}-Windows-Installer"
path: ${{ github.workspace }}/obs-ios-camera-source/package/*.exe
macOS:
name: "macOS 64-bit"
environment: production
runs-on: [macos-latest]
if: contains(github.event.head_commit.message, '[skip ci]') != true # skip ci if the commit message contains "[skip ci]"
env:
MACOS_DEPS_VERSION: "2021-12-05"
MACOS_DEPS_CACHE_VERSION: "1" # Change whenever updating dependencies version, in order to force a cache reset
steps:
- name: "Checkout obs-ios-camera-source"
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-ios-camera-source
submodules: "recursive"
- name: "Checkout OBS-Studio"
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: "recursive"
- name: "Install Prerequisite: Application Signing Certificate"
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLICATION_CERTIFICATE }}
p12-password: ${{ secrets.APPLICATION_CERTIFICATE_PASSWORD }}
keychain-password: password
- name: "Install Prerequisite: Installer Signing Certificate"
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.INSTALLER_CERTIFICATE }}
p12-password: ${{ secrets.INSTALLER_CERTIFICATE_PASSWORD }}
keychain-password: password
create-keychain: false
- name: "Get OBS-Studio Git Info"
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: "Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})"
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: "Get obs-ios-camera-source git info"
shell: bash
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: |
git fetch --prune --unshallow
GIT_HASH=$(git rev-parse --short HEAD)
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
GIT_TAG=$(git describe --exact-match --tags --abbrev=0) || GIT_TAG=""
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV
if [ "$GIT_TAG" ] ; then \
VERSION="$GIT_TAG" \
VERSION_SUFFIX=$(echo "$GIT_TAG" | cut -c6-20) ; \
else \
VERSION="$GIT_HASH-git" \
VERSION_SUFFIX="-$GIT_HASH-git" ; \
fi
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
echo "CMAKE_VERSION_SUFFIX=$VERSION_SUFFIX" >> $GITHUB_ENV
- name: "Install Packages"
shell: bash
run: |
curl -L -O http://s.sudre.free.fr/Software/files/Packages.dmg
sudo hdiutil attach ./Packages.dmg
sudo installer -pkg /Volumes/Packages\ 1.2.10/Install\ Packages.pkg -target /
- name: "Restore Cached Qt & OBS-Studio dependencies"
id: deps-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/obsdeps/**
key: "deps-cache-${{ env.MACOS_DEPS_CACHE_VERSION }} | ${{ runner.os }}"
restore-keys: | # May not be necessary
deps-cache-${{ env.MACOS_DEPS_CACHE_VERSION }} | ${{ runner.os }}
- run: mkdir -p obsdeps
if: steps.deps-cache.outputs.cache-hit != 'true'
shell: bash
- name: "Install Prerequisite: Qt"
if: steps.deps-cache.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/macos-deps-qt-${{ env.MACOS_DEPS_VERSION }}-universal.tar.xz
tar -xf macos-deps-qt-${{ env.MACOS_DEPS_VERSION }}-universal.tar.xz -C "./obsdeps"
- name: "Install Prerequisite: Pre-built OBS-Studio dependencies"
if: steps.deps-cache.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/macos-deps-${{ env.MACOS_DEPS_VERSION }}-universal.tar.xz
tar -xf macos-deps-${{ env.MACOS_DEPS_VERSION }}-universal.tar.xz -C "./obsdeps"
- run: xattr -r -d com.apple.quarantine ./obsdeps
shell: bash
- name: "Configue OBS-Studio"
if: steps.cache-obs-build.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
mkdir -p ./build
cd ./build
cmake .. \
-DQTDIR=${{ github.workspace }}/obsdeps \
-DDepsPath=${{ github.workspace }}/obsdeps \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
-DDISABLE_PLUGINS=true \
-DENABLE_SCRIPTING=0 \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/obsdeps/lib/cmake
- name: "Build OBS-Studio"
if: steps.cache-obs-build.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
set -e
cd ./build
make -j4 libobs obs-frontend-api
- name: "Configure obs-ios-camera-source"
working-directory: ${{ github.workspace }}/obs-ios-camera-source
shell: bash # OpenSSL is provided in the mac image https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md
run: |
mkdir -p build
cd build
cmake .. \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
-DQTDIR=${{ github.workspace }}/obsdeps \
-DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs \
-DLIBOBS_LIB=${{ github.workspace }}/obs-studio/libobs \
-DOBS_FRONTEND_LIB="${{ github.workspace }}/obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr
- name: "Build obs-ios-camera-source"
working-directory: ${{ github.workspace }}/obs-ios-camera-source
shell: bash
run: |
set -e
cd ./build
make -j4
- name: "Sign plugin binary"
shell: bash
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: |
install_name_tool \
-change /tmp/obsdeps/lib/QtWidgets.framework/Versions/5/QtWidgets \
@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets \
-change /tmp/obsdeps/lib/QtGui.framework/Versions/5/QtGui \
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui \
-change /tmp/obsdeps/lib/QtCore.framework/Versions/5/QtCore \
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore \
-change /tmp/obsdeps/lib/QtNetwork.framework/Versions/5/QtNetwork \
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork \
-change /tmp/obsdeps/lib/QtSvg.framework/Versions/5/QtSvg \
@executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg \
./build/obs-ios-camera-source.so
codesign --sign "${{ secrets.APPLICATION_CERTIFICATE_IDENTITY }}" ./build/obs-ios-camera-source.so
- name: "Set PR Artifact Filename"
shell: bash
run: |
echo "MACOS_FILENAME=obs-ios-camera-source-${{ env.PACKAGE_VERSION }}-macOS.pkg" >> $GITHUB_ENV
echo "MACOS_FILENAME_UNSIGNED=obs-ios-camera-source-${{ env.PACKAGE_VERSION }}-macOS-Unsigned.pkg" >> $GITHUB_ENV
- name: "Package ${{ env.MACOS_FILENAME_UNSIGNED }}"
if: success()
working-directory: ${{ github.workspace }}/obs-ios-camera-source
shell: bash
run: |
packagesbuild ./CI/macos/obs-ios-camera-source.pkgproj
mv ./release/obs-ios-camera-source.pkg ./release/${{ env.MACOS_FILENAME_UNSIGNED }}
- name: "Sign plugin package"
shell: bash
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: |
productsign \
--sign "${{ secrets.INSTALLER_CERTIFICATE_IDENTITY }}" \
./release/${{ env.MACOS_FILENAME_UNSIGNED }} \
./release/${{ env.MACOS_FILENAME }}
rm ./release/${{ env.MACOS_FILENAME_UNSIGNED }}
- name: "Notarize package"
shell: bash
working-directory: ${{ github.workspace }}/obs-ios-camera-source
run: |
zip -r ./release/${{ env.MACOS_FILENAME }}.zip ./release/${{ env.MACOS_FILENAME }}
UPLOAD_RESULT=$(xcrun altool --notarize-app \
--primary-bundle-id "io.loftlabs.obs-ios-camera-source" \
--username "${{ secrets.AC_USERNAME }}" \
--password "${{ secrets.AC_PASSWORD }}" \
--asc-provider "${{ secrets.AC_PROVIDER_SHORTNAME }}" \
--file "./release/${{ env.MACOS_FILENAME }}.zip")
rm ./release/${{ env.MACOS_FILENAME }}.zip
REQUEST_UUID=$(echo $UPLOAD_RESULT | awk -F ' = ' '/RequestUUID/ {print $2}')
# Pieces of code borrowed from rednoah/notarized-app
while sleep 30 && date; do
CHECK_RESULT=$(xcrun altool \
--notarization-info "$REQUEST_UUID" \
--username "${{ secrets.AC_USERNAME }}" \
--password "${{ secrets.AC_PASSWORD }}" \
--asc-provider "${{ secrets.AC_PROVIDER_SHORTNAME }}")
if ! grep -q "Status: in progress" <<< "$CHECK_RESULT"; then
xcrun stapler staple ./release/${{ env.MACOS_FILENAME }}
break
fi
done
- name: "Publish ${{ env.MACOS_FILENAME }}"
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: "obs-ios-camera-source-${{ env.PACKAGE_VERSION }}-macOS"
path: "${{ github.workspace }}/obs-ios-camera-source/release/${{ env.MACOS_FILENAME }}"