This repository has been archived by the owner on Dec 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a .pkg distribution automatically with GitHub Actions (#82)
* Initial version of potential GitHub actions pkg build * Fix working directory for package script * Fix path to .so file * Add step to install packagesbuild * Dont check for packagesbuild we know it's not installed * Point installer to correct path for .so file * Don't forget locales * Fix format of recalling secrets * Try to bundle the DAL plugin as well * Force re-signature of the DAL plugin * Separate workflow for build from release * s/pull-request/pull_request/
- Loading branch information
1 parent
77d9dcb
commit 5db91b4
Showing
10 changed files
with
997 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout obs-studio | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: obsproject/obs-studio | ||
path: obs-studio | ||
submodules: recursive | ||
ref: 25.0.8 | ||
|
||
- name: Checkout obs-mac-virtualcam | ||
uses: actions/checkout@v2 | ||
with: | ||
path: obs-mac-virtualcam | ||
|
||
- name: Install OBS deps | ||
run: | | ||
brew install FFmpeg x264 Qt5 cmake mbedtls swig | ||
- name: Build OBS | ||
run: | | ||
mkdir obs-studio/build | ||
cd obs-studio/build | ||
export QTDIR=/usr/local/opt/qt | ||
cmake .. | ||
make -j | ||
- name: Build the plugin | ||
run: | | ||
mkdir obs-mac-virtualcam/build | ||
cd obs-mac-virtualcam/build | ||
cmake -DLIBOBS_INCLUDE_DIR:STRING=$GITHUB_WORKSPACE/obs-studio/libobs \ | ||
-DLIBOBS_LIB:STRING=$GITHUB_WORKSPACE/obs-studio/build/libobs/libobs.dylib \ | ||
-DOBS_FRONTEND_LIB:STRING=$GITHUB_WORKSPACE/obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib \ | ||
-DQTDIR:STRING=/usr/local/opt/qt .. | ||
make -j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
build/ | ||
xcode/ | ||
.DS_Store | ||
*.generated.* | ||
/installer/Output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
cmake_minimum_required(VERSION 3.17) | ||
project(mac-virtualcam) | ||
|
||
project(obs-mac-virtualcam VERSION 1.0.0) | ||
set(PLUGIN_AUTHOR "John Boiles") | ||
set(MACOS_BUNDLEID "com.johnboiles.obs-mac-virtualcam") | ||
|
||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11") | ||
|
||
configure_file( | ||
installer/installer-macOS.pkgproj.in | ||
../installer/installer-macOS.generated.pkgproj | ||
) | ||
|
||
configure_file( | ||
ci/ci_includes.sh.in | ||
../ci/ci_includes.generated.sh | ||
) | ||
configure_file( | ||
ci/ci_includes.cmd.in | ||
../ci/ci_includes.generated.cmd | ||
) | ||
|
||
add_subdirectory(src/obs-plugin) | ||
add_subdirectory(src/dal-plugin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
set PluginName=@CMAKE_PROJECT_NAME@ | ||
set PluginVersion=@CMAKE_PROJECT_VERSION@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PLUGIN_NAME="@CMAKE_PROJECT_NAME@" | ||
PLUGIN_VERSION="@CMAKE_PROJECT_VERSION@" | ||
MACOS_BUNDLEID="@MACOS_BUNDLEID@" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
script_dir=$(dirname "$0") | ||
source "$script_dir/../ci_includes.generated.sh" | ||
|
||
OSTYPE=$(uname) | ||
|
||
if [ "${OSTYPE}" != "Darwin" ]; then | ||
echo "[Error] macOS package script can be run on Darwin-type OS only." | ||
exit 1 | ||
fi | ||
|
||
echo "=> Preparing package build" | ||
export QT_CELLAR_PREFIX="$(/usr/bin/find /usr/local/Cellar/qt -d 1 | sort -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1)" | ||
|
||
GIT_HASH=$(git rev-parse --short HEAD) | ||
GIT_BRANCH_OR_TAG=$(git name-rev --name-only HEAD | awk -F/ '{print $NF}') | ||
|
||
PKG_VERSION="$GIT_HASH-$GIT_BRANCH_OR_TAG" | ||
|
||
FILENAME_UNSIGNED="$PLUGIN_NAME-$PKG_VERSION-Unsigned.pkg" | ||
FILENAME="$PLUGIN_NAME-$PKG_VERSION.pkg" | ||
|
||
# echo "=> Modifying $PLUGIN_NAME.so" | ||
# install_name_tool \ | ||
# -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets \ | ||
# @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets \ | ||
# -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui \ | ||
# @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui \ | ||
# -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore \ | ||
# @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore \ | ||
# ./build/src/obs-plugin/obs-mac-virtualcam.so | ||
|
||
# Check if replacement worked | ||
echo "=> Dependencies for $PLUGIN_NAME" | ||
otool -L ./build/src/obs-plugin/obs-mac-virtualcam.so | ||
|
||
if [[ "$RELEASE_MODE" == "True" ]]; then | ||
echo "=> Signing plugin binary: $PLUGIN_NAME.so" | ||
codesign --sign "$CODE_SIGNING_IDENTITY" ./build/src/obs-plugin/obs-mac-virtualcam.so | ||
codesign --sign "$CODE_SIGNING_IDENTITY" --force --deep ./build/src/dal-plugin/obs-mac-virtualcam.plugin | ||
else | ||
echo "=> Skipped plugin codesigning" | ||
fi | ||
|
||
# Fetch and install Packages app | ||
# =!= NOTICE =!= | ||
# Installs a LaunchDaemon under /Library/LaunchDaemons/fr.whitebox.packages.build.dispatcher.plist | ||
# =!= NOTICE =!= | ||
echo "=> Installing Packaging app (might require password due to 'sudo').." | ||
curl -o './Packages.pkg' --retry-connrefused -s --retry-delay 1 'https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg' | ||
sudo installer -pkg ./Packages.pkg -target / | ||
|
||
echo "=> Actual package build" | ||
packagesbuild ./installer/installer-macOS.generated.pkgproj | ||
|
||
echo "=> Renaming $PLUGIN_NAME.pkg to $FILENAME" | ||
mv ./release/$PLUGIN_NAME.pkg ./release/$FILENAME_UNSIGNED | ||
|
||
if [[ "$RELEASE_MODE" == "True" ]]; then | ||
echo "=> Signing installer: $FILENAME" | ||
productsign \ | ||
--sign "$INSTALLER_SIGNING_IDENTITY" \ | ||
./release/$FILENAME_UNSIGNED \ | ||
./release/$FILENAME | ||
rm ./release/$FILENAME_UNSIGNED | ||
|
||
echo "=> Submitting installer $FILENAME for notarization" | ||
zip -r ./release/$FILENAME.zip ./release/$FILENAME | ||
UPLOAD_RESULT=$(xcrun altool \ | ||
--notarize-app \ | ||
--primary-bundle-id "$MACOS_BUNDLEID" \ | ||
--username "$AC_USERNAME" \ | ||
--password "$AC_PASSWORD" \ | ||
--asc-provider "$AC_PROVIDER_SHORTNAME" \ | ||
--file "./release/$FILENAME.zip") | ||
rm ./release/$FILENAME.zip | ||
|
||
REQUEST_UUID=$(echo $UPLOAD_RESULT | awk -F ' = ' '/RequestUUID/ {print $2}') | ||
echo "Request UUID: $REQUEST_UUID" | ||
|
||
echo "=> Wait for notarization result" | ||
# Pieces of code borrowed from rednoah/notarized-app | ||
while sleep 30 && date; do | ||
CHECK_RESULT=$(xcrun altool \ | ||
--notarization-info "$REQUEST_UUID" \ | ||
--username "$AC_USERNAME" \ | ||
--password "$AC_PASSWORD" \ | ||
--asc-provider "$AC_PROVIDER_SHORTNAME") | ||
echo $CHECK_RESULT | ||
|
||
if ! grep -q "Status: in progress" <<< "$CHECK_RESULT"; then | ||
echo "=> Staple ticket to installer: $FILENAME" | ||
xcrun stapler staple ./release/$FILENAME | ||
break | ||
fi | ||
done | ||
else | ||
echo "=> Skipped installer codesigning and notarization" | ||
fi |
Empty file.
Oops, something went wrong.
https://github.com/KAWATAtoshiaki/kawata.git