From 9047d6c5b7b473428436de5a1bd79aabeff67057 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 03:54:54 -0500 Subject: [PATCH 01/53] Create cmake.yml --- .github/workflows/cmake.yml | 99 +++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000..962f059a --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,99 @@ +name: CMake + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: install deps + run: sudo apt-get install \ + build-essential \ + checkinstall \ + cmake \ + git \ + libmbedtls-dev \ + libasound2-dev \ + libavcodec-dev \ + libavdevice-dev \ + libavfilter-dev \ + libavformat-dev \ + libavutil-dev \ + libcurl4-openssl-dev \ + libfdk-aac-dev \ + libfontconfig-dev \ + libfreetype6-dev \ + libgl1-mesa-dev \ + libjack-jackd2-dev \ + libjansson-dev \ + libluajit-5.1-dev \ + libpulse-dev \ + libqt5x11extras5-dev \ + libspeexdsp-dev \ + libswresample-dev \ + libswscale-dev \ + libudev-dev \ + libv4l-dev \ + libvlc-dev \ + libx11-dev \ + libx264-dev \ + libxcb-shm0-dev \ + libxcb-xinerama0-dev \ + libxcomposite-dev \ + libxinerama-dev \ + pkg-config \ + python3-dev \ + qtbase5-dev \ + libqt5svg5-dev \ + swig \ + libxcb-randr0-dev \ + libxcb-xfixes0-dev \ + libx11-xcb-dev \ + libxcb1-dev \ + libxss-dev + run: apt install libnss3-dev + run: wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4280_linux64.tar.bz2 + run: tar -xjf ./cef_binary_4280_linux64.tar.bz2 + run: git clone --recursive https://github.com/obsproject/obs-studio.git + run: cd obs-studio + run: mkdir build && cd build + run: cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4280_linux64" .. + run: make -j4 + run: sudo checkinstall --default --pkgname=obs-studio --fstrans=no --backup=no --pkgversion="$(date +%Y%m%d)-git" --deldoc=yes + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash + working-directory: ${{github.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $BUILD_TYPE + + - name: Test + working-directory: ${{github.workspace}}/build + shell: bash + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C $BUILD_TYPE From 25e4f5eebc17777c7bf4a40f93ccd4306ce5f726 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 03:59:01 -0500 Subject: [PATCH 02/53] Update cmake.yml --- .github/workflows/cmake.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 962f059a..5ef774c1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -61,15 +61,25 @@ jobs: libx11-xcb-dev \ libxcb1-dev \ libxss-dev - run: apt install libnss3-dev - run: wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4280_linux64.tar.bz2 - run: tar -xjf ./cef_binary_4280_linux64.tar.bz2 - run: git clone --recursive https://github.com/obsproject/obs-studio.git - run: cd obs-studio - run: mkdir build && cd build - run: cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4280_linux64" .. - run: make -j4 - run: sudo checkinstall --default --pkgname=obs-studio --fstrans=no --backup=no --pkgversion="$(date +%Y%m%d)-git" --deldoc=yes + + - name: Create Build Environment + run: apt install libnss3-dev + - name: Create Build Environment + run: wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4280_linux64.tar.bz2 + - name: Create Build Environment + run: tar -xjf ./cef_binary_4280_linux64.tar.bz2 + - name: Create Build Environment + run: git clone --recursive https://github.com/obsproject/obs-studio.git + - name: Create Build Environment + run: cd obs-studio + - name: Create Build Environment + run: mkdir build && cd build + - name: Create Build Environment + run: cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4280_linux64" .. + - name: Create Build Environment + run: make -j4 + - name: Create Build Environment + run: sudo checkinstall --default --pkgname=obs-studio --fstrans=no --backup=no --pkgversion="$(date +%Y%m%d)-git" --deldoc=yes - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands From 5395f012308ec40460c7614a7adc0e8a92e3790d Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 04:00:45 -0500 Subject: [PATCH 03/53] Update cmake.yml --- .github/workflows/cmake.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5ef774c1..e8025f7c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 + - name: update repo + run: sudo apt-get update - name: install deps run: sudo apt-get install \ build-essential \ @@ -63,7 +65,7 @@ jobs: libxss-dev - name: Create Build Environment - run: apt install libnss3-dev + run: sudo apt install libnss3-dev - name: Create Build Environment run: wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4280_linux64.tar.bz2 - name: Create Build Environment From 522cee46b2a03d9096e4c84928611694ec6fa23e Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 04:03:25 -0500 Subject: [PATCH 04/53] Update cmake.yml --- .github/workflows/cmake.yml | 788 +++++++++++++++++++++++++++++++----- 1 file changed, 684 insertions(+), 104 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e8025f7c..160dfad9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,111 +1,691 @@ -name: CMake +name: 'CI Multiplatform Build' -on: [push] +on: + push: + paths-ignore: + - '**.md' + branches: + - master + tags: + - '*' + pull_request: + paths-ignore: + - '**.md' + branches: + - master env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release + MACOS_CEF_BUILD_VERSION: '4183' + LINUX_CEF_BUILD_VERSION: '4280' + CEF_VERSION: '75.1.16+g16a67c4+chromium-75.0.3770.100' + TWITCH_CLIENTID: ${{ secrets.TWITCH_CLIENT_ID }} + TWITCH_HASH: ${{ secrets.TWITCH_HASH }} + RESTREAM_CLIENTID: ${{ secrets.RESTREAM_CLIENTID }} + RESTREAM_HASH: ${{ secrets.RESTREAM_HASH }} jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest + macos64: + name: 'macOS 64-bit' + runs-on: [macos-latest] + env: + MIN_MACOS_VERSION: '10.13' + MACOS_DEPS_VERSION: '2020-12-22' + VLC_VERSION: '3.0.8' + SPARKLE_VERSION: '1.23.0' + QT_VERSION: '5.15.2' + SIGN_IDENTITY: '' + steps: + - name: 'Checkout' + uses: actions/checkout@v2.3.3 + with: + submodules: 'recursive' + - name: 'Fetch Git Tags' + run: | + git fetch --prune --unshallow + echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV + echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: 'Check for Github Labels' + if: github.event_name == 'pull_request' + run: | + LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')" + LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)" + if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then + echo "SEEKING_TESTERS=1" >> $GITHUB_ENV + else + echo "SEEKING_TESTERS=0" >> $GITHUB_ENV + fi + - name: 'Setup build environment (Homebrew + ENV)' + shell: bash + run: | + if [ -d /usr/local/opt/openssl@1.0.2t ]; then + brew uninstall openssl@1.0.2t + brew untap local/openssl + fi + + if [ -d /usr/local/opt/python@2.7.17 ]; then + brew uninstall python@2.7.17 + brew untap local/python2 + fi + + if [ -d /usr/local/opt/speexdsp ]; then + brew unlink speexdsp + fi + brew uninstall curl php + brew bundle --file ./CI/scripts/macos/Brewfile + echo "NPROC=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + - name: 'Restore Chromium Embedded Framework from cache' + id: cef-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'cef-cache' + with: + path: ${{ github.workspace }}/cmbuild/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64 + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.MACOS_CEF_BUILD_VERSION }} + - name: 'Restore VLC dependency from cache' + id: vlc-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'vlc-cache' + with: + path: ${{ github.workspace }}/cmbuild/vlc-${{ env.VLC_VERSION }} + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION }} + - name: 'Restore Sparkle dependency from cache' + id: sparkle-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'sparkle-cache' + with: + path: ${{ github.workspace }}/cmbuild/sparkle + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.SPARKLE_VERSION }} + - name: 'Install prerequisite: Pre-built 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 }}.tar.gz + tar -xf ./macos-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp" + - name: 'Install prerequisite: Pre-built dependency Qt' + if: steps.deps-qt-cache.outputs.cache-hit != 'true' + shell: bash + run: | + 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 + tar -xf ./macos-qt-${{ env.QT_VERSION }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp" + xattr -r -d com.apple.quarantine /tmp/obsdeps + - name: 'Install prerequisite: VLC' + if: steps.vlc-cache.outputs.cache-hit != 'true' + shell: bash + run: | + curl -L -O https://downloads.videolan.org/vlc/${{ env.VLC_VERSION }}/vlc-${{ env.VLC_VERSION }}.tar.xz + if [ ! -d "${{ github.workspace }}/cmbuild" ]; then mkdir "${{ github.workspace }}/cmbuild"; fi + tar -xf ./vlc-${{ env.VLC_VERSION }}.tar.xz -C "${{ github.workspace }}/cmbuild" + - name: 'Install prerequisite: Sparkle' + if: steps.sparkle-cache.outputs.cache-hit != 'true' + shell: bash + run: | + curl -L -o sparkle.tar.bz2 https://github.com/sparkle-project/Sparkle/releases/download/${{ env.SPARKLE_VERSION }}/Sparkle-${{ env.SPARKLE_VERSION }}.tar.bz2 + mkdir ${{ github.workspace }}/cmbuild/sparkle + tar -xf ./sparkle.tar.bz2 -C ${{ github.workspace }}/cmbuild/sparkle + - name: 'Setup prerequisite: Sparkle' + shell: bash + run: sudo cp -R ${{ github.workspace }}/cmbuild/sparkle/Sparkle.framework /Library/Frameworks/Sparkle.framework + - name: 'Install prerequisite: Chromium Embedded Framework' + if: steps.cef-cache.outputs.cache-hit != 'true' + shell: bash + run: | + curl -L -O https://cdn-fastly.obsproject.com/downloads/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64.tar.bz2 + tar -xf ./cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64.tar.bz2 -C ${{ github.workspace }}/cmbuild/ + cd ${{ github.workspace }}/cmbuild/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64 + /usr/bin/sed -i '.orig' '/add_subdirectory(tests\/ceftests)/d' ./CMakeLists.txt + /usr/bin/sed -i '.orig' s/\"10.9\"/\"${{ env.MIN_MACOS_VERSION }}\"/ ./cmake/cef_variables.cmake + mkdir build && cd build + cmake -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -Wno-deprecated-declarations" -DCMAKE_EXE_LINKER_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MIN_MACOS_VERSION }} .. + make -j${NPROC:-4} + mkdir libcef_dll + cd ../../ + - name: 'Configure' + shell: bash + run: | + mkdir ./build + cd ./build + LEGACY_BROWSER="$(test "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 && echo "ON" || echo "OFF")" + cmake -DENABLE_UNIT_TESTS=YES -DENABLE_SPARKLE_UPDATER=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MIN_MACOS_VERSION }} -DQTDIR="/tmp/obsdeps" -DSWIGDIR="/tmp/obsdeps" -DDepsPath="/tmp/obsdeps" -DVLCPath="${{ github.workspace }}/cmbuild/vlc-${{ env.VLC_VERSION }}" -DENABLE_VLC=ON -DBUILD_BROWSER=ON -DBROWSER_LEGACY=$LEGACY_BROWSER -DWITH_RTMPS=ON -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' .. + - name: 'Build' + shell: bash + working-directory: ${{ github.workspace }}/build + run: make -j${NPROC:-4} + - name: 'Test' + shell: bash + working-directory: ${{ github.workspace }}/build + run: make CTEST_OUTPUT_ON_FAILURE=1 test + - name: 'Install prerequisite: DMGbuild' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + shell: bash + run: | + pip3 install dmgbuild + - name: 'Install Apple Developer Certificate' + if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' + uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071 + with: + p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }} + p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }} + - name: 'Set Signing Identity' + if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' + run: | + echo "SIGN_IDENTITY=${{ secrets.MACOS_SIGNING_IDENTITY }}" >> $GITHUB_ENV + - name: 'Create macOS application bundle' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + working-directory: ${{ github.workspace }}/build + shell: bash + run: | + if [ -d ./OBS.app ]; then rm -rf ./OBS.app; fi + mkdir -p OBS.app/Contents/MacOS + mkdir OBS.app/Contents/PlugIns + mkdir OBS.app/Contents/Resources + mkdir OBS.app/Contents/Frameworks + + cp rundir/RelWithDebInfo/bin/obs ./OBS.app/Contents/MacOS + cp rundir/RelWithDebInfo/bin/obs-ffmpeg-mux ./OBS.app/Contents/MacOS + if ! [ "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 ]; then + cp -R "rundir/RelWithDebInfo/bin/OBS Helper.app" "./OBS.app/Contents/Frameworks/OBS Helper.app" + cp -R "rundir/RelWithDebInfo/bin/OBS Helper (GPU).app" "./OBS.app/Contents/Frameworks/OBS Helper (GPU).app" + cp -R "rundir/RelWithDebInfo/bin/OBS Helper (Plugin).app" "./OBS.app/Contents/Frameworks/OBS Helper (Plugin).app" + cp -R "rundir/RelWithDebInfo/bin/OBS Helper (Renderer).app" "./OBS.app/Contents/Frameworks/OBS Helper (Renderer).app" + fi + cp rundir/RelWithDebInfo/bin/libobsglad.0.dylib ./OBS.app/Contents/MacOS + cp -R rundir/RelWithDebInfo/data ./OBS.app/Contents/Resources + cp ../CI/scripts/macos/app/AppIcon.icns ./OBS.app/Contents/Resources + cp -R rundir/RelWithDebInfo/obs-plugins/ ./OBS.app/Contents/PlugIns + cp ../CI/scripts/macos/app/Info.plist ./OBS.app/Contents + + if [ -d ./OBS.app/Contents/Resources/data/obs-scripting ]; then + mv ./OBS.app/Contents/Resources/data/obs-scripting/obslua.so ./OBS.app/Contents/MacOS/ + mv ./OBS.app/Contents/Resources/data/obs-scripting/_obspython.so ./OBS.app/Contents/MacOS/ + mv ./OBS.app/Contents/Resources/data/obs-scripting/obspython.py ./OBS.app/Contents/MacOS/ + rm -rf ./OBS.app/Contents/Resources/data/obs-scripting/ + fi + + BUNDLE_PLUGINS=( + ./OBS.app/Contents/PlugIns/coreaudio-encoder.so + ./OBS.app/Contents/PlugIns/decklink-ouput-ui.so + ./OBS.app/Contents/PlugIns/decklink-captions.so + ./OBS.app/Contents/PlugIns/frontend-tools.so + ./OBS.app/Contents/PlugIns/image-source.so + ./OBS.app/Contents/PlugIns/mac-avcapture.so + ./OBS.app/Contents/PlugIns/mac-capture.so + ./OBS.app/Contents/PlugIns/mac-decklink.so + ./OBS.app/Contents/PlugIns/mac-syphon.so + ./OBS.app/Contents/PlugIns/mac-vth264.so + ./OBS.app/Contents/PlugIns/mac-virtualcam.so + ./OBS.app/Contents/PlugIns/obs-browser.so + ./OBS.app/Contents/PlugIns/obs-ffmpeg.so + ./OBS.app/Contents/PlugIns/obs-filters.so + ./OBS.app/Contents/PlugIns/obs-transitions.so + ./OBS.app/Contents/PlugIns/obs-vst.so + ./OBS.app/Contents/PlugIns/rtmp-services.so + ./OBS.app/Contents/MacOS/obs-ffmpeg-mux + ./OBS.app/Contents/MacOS/obslua.so + ./OBS.app/Contents/MacOS/_obspython.so + ./OBS.app/Contents/PlugIns/obs-x264.so + ./OBS.app/Contents/PlugIns/text-freetype2.so + ./OBS.app/Contents/PlugIns/obs-outputs.so + ) + + if ! [ "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 ]; then + ../CI/scripts/macos/app/dylibBundler -cd -of -a ./OBS.app -q -f \ + -s ./OBS.app/Contents/MacOS \ + -s "${{ github.workspace }}/cmbuild/sparkle/Sparkle.framework" \ + -s ./rundir/RelWithDebInfo/bin \ + $(echo "${BUNDLE_PLUGINS[@]/#/-x }") + else + ../CI/scripts/macos/app/dylibBundler -cd -of -a ./OBS.app -q -f \ + -s ./OBS.app/Contents/MacOS \ + -s "${{ github.workspace }}/cmbuild/sparkle/Sparkle.framework" \ + -s ./rundir/RelWithDebInfo/bin \ + $(echo "${BUNDLE_PLUGINS[@]/#/-x }") \ + -x ./OBS.app/Contents/PlugIns/obs-browser-page + fi + + mv ./libobs-opengl/libobs-opengl.so ./OBS.app/Contents/Frameworks + + cp -R /tmp/obsdeps/lib/QtNetwork.framework ./OBS.app/Contents/Frameworks + chmod -R +w ./OBS.app/Contents/Frameworks/QtNetwork.framework + rm -r ./OBS.app/Contents/Frameworks/QtNetwork.framework/Headers + rm -r ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/Headers/ + chmod 644 ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/Resources/Info.plist + install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork + install_name_tool -change /tmp/obsdeps/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork + + cp -R "${{ github.workspace }}/cmbuild/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64/Release/Chromium Embedded Framework.framework" ./OBS.app/Contents/Frameworks/ + chown -R $(whoami) ./OBS.app/Contents/Frameworks/ + + cp ../CI/scripts/macos/app/OBSPublicDSAKey.pem ./OBS.app/Contents/Resources + + if [ "${GITHUB_REF:0:10}" = "refs/tags/" ]; then + plutil -insert CFBundleVersion -string ${{ env.OBS_GIT_TAG }} ./OBS.app/Contents/Info.plist + plutil -insert CFBundleShortVersionString -string ${{ env.OBS_GIT_TAG }} ./OBS.app/Contents/Info.plist + else + plutil -insert CFBundleVersion -string ${{ env.OBS_GIT_TAG }}-${{ env.OBS_GIT_HASH }} ./OBS.app/Contents/Info.plist + plutil -insert CFBundleShortVersionString -string ${{ env.OBS_GIT_TAG }}-${{ env.OBS_GIT_HASH }} ./OBS.app/Contents/Info.plist + fi + + plutil -insert OBSFeedsURL -string https://obsproject.com/osx_update/feeds.xml ./OBS.app/Contents/Info.plist + plutil -insert SUFeedURL -string https://obsproject.com/osx_update/stable/updates.xml ./OBS.app/Contents/Info.plist + plutil -insert SUPublicDSAKeyFile -string OBSPublicDSAKey.pem ./OBS.app/Contents/Info.plist + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop" + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate" + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" --deep ./OBS.app/Contents/Frameworks/Sparkle.framework + + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libEGL.dylib" + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libswiftshader_libEGL.dylib" + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib" + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libswiftshader_libGLESv2.dylib" + if ! [ "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 ]; then + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libvk_swiftshader.dylib" + fi + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework" + + codesign --force --options runtime --deep --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Resources/data/obs-mac-virtualcam.plugin" + + codesign --force --options runtime --entitlements "../CI/scripts/macos/app/entitlements.plist" --sign "${SIGN_IDENTITY:--}" --deep ./OBS.app + + if ! [ "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 ]; then + codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/OBS Helper.app" + codesign --force --options runtime --entitlements "../CI/scripts/macos/helpers/helper-gpu-entitlements.plist" --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (GPU).app" + codesign --force --options runtime --entitlements "../CI/scripts/macos/helpers/helper-plugin-entitlements.plist" --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (Plugin).app" + codesign --force --options runtime --entitlements "../CI/scripts/macos/helpers/helper-renderer-entitlements.plist" --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (Renderer).app" + fi + + codesign -dvv ./OBS.app + - name: 'Package' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + working-directory: ${{ github.workspace }}/build + shell: bash + run: | + FILE_DATE=$(date +%Y-%m-%d) + FILE_NAME=$FILE_DATE-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-macOS.dmg + echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV + + cp ../CI/scripts/macos/package/settings.json.template ./settings.json + /usr/bin/sed -i '' 's#\$\$VERSION\$\$#${{ env.OBS_GIT_TAG }}#g' ./settings.json + /usr/bin/sed -i '' 's#\$\$CI_PATH\$\$#../CI/scripts/macos#g' ./settings.json + /usr/bin/sed -i '' 's#\$\$BUNDLE_PATH\$\$#${{ github.workspace }}/build#g' ./settings.json + + dmgbuild "OBS-Studio ${{ env.OBS_GIT_TAG }}" "${FILE_NAME}" -s ./settings.json + mkdir ../nightly + codesign --force --sign "${SIGN_IDENTITY:--}" ./"${FILE_NAME}" + codesign -dvv ./"${FILE_NAME}" + sudo cp ./${FILE_NAME} ../nightly/${FILE_NAME} + - name: 'Publish' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + uses: actions/upload-artifact@v2.2.0 + with: + name: '${{ env.FILE_NAME }}' + path: ./nightly/*.dmg + - name: 'Package Release' + if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' + working-directory: ${{ github.workspace }}/build + shell: bash + run: | + FILE_DATE=$(date +%Y-%m-%d) + FILE_NAME=$FILE_DATE-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-macOS.dmg + RELEASE_FILE_NAME=$FILE_DATE-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-rel-macOS.dmg + echo "RELEASE_FILE_NAME=${RELEASE_FILE_NAME}" >> $GITHUB_ENV + + xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.MACOS_NOTARIZATION_USERNAME }}" -p "${{ secrets.MACOS_NOTARIZATION_PASSWORD }}" + + xcnotary precheck "./OBS.app" + + if [ "$?" -eq 0 ]; then + xcnotary notarize "$FILE_NAME" --developer-account "${{ secrets.MACOS_NOTARIZATION_USERNAME }}" --developer-password-keychain-item "AC_PASSWORD" --provider "${{ secrets.ASC_PROVIDER_SHORTNAME }}" + else + return 1 + fi + + mkdir ../release + sudo mv ./$FILE_NAME ../release/$RELEASE_FILE_NAME + - name: 'Publish Release' + if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' + uses: actions/upload-artifact@v2.2.0 + with: + name: '${{ env.RELEASE_FILE_NAME }}' + path: ./release/*.dmg + ubuntu64: + name: 'Linux/Ubuntu 64-bit' + runs-on: [ubuntu-latest] + steps: + - name: 'Checkout' + uses: actions/checkout@v2.3.3 + with: + submodules: 'recursive' + - name: 'Fetch Git Tags' + run: | + git fetch --prune --unshallow + echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV + echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: 'Check for Github Labels' + if: github.event_name == 'pull_request' + run: | + LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')" + LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)" + if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then + echo "SEEKING_TESTERS=1" >> $GITHUB_ENV + else + echo "SEEKING_TESTERS=0" >> $GITHUB_ENV + fi + - name: Install prerequisites (Apt) + shell: bash + run: | + echo "NPROC=$(($(nproc)+1))" >> $GITHUB_ENV + sudo dpkg --add-architecture amd64 + sudo apt-get -qq update + sudo apt-get install -y \ + build-essential \ + checkinstall \ + cmake \ + libasound2-dev \ + libavcodec-dev \ + libavdevice-dev \ + libavfilter-dev \ + libavformat-dev \ + libavutil-dev \ + libcurl4-openssl-dev \ + libfdk-aac-dev \ + libfontconfig-dev \ + libfreetype6-dev \ + libgl1-mesa-dev \ + libjack-jackd2-dev \ + libjansson-dev \ + libluajit-5.1-dev \ + libpulse-dev \ + libqt5x11extras5-dev \ + libsndio-dev \ + libspeexdsp-dev \ + libswresample-dev \ + libswscale-dev \ + libudev-dev \ + libv4l-dev \ + libva-dev \ + libvlc-dev \ + libx11-dev \ + libx264-dev \ + libxcb-randr0-dev \ + libxcb-shm0-dev \ + libxcb-xinerama0-dev \ + libxcomposite-dev \ + libxinerama-dev \ + libmbedtls-dev \ + pkg-config \ + python3-dev \ + qtbase5-dev \ + libqt5svg5-dev \ + swig \ + libcmocka-dev \ + linux-generic \ + v4l2loopback-dkms + - name: 'Restore Chromium Embedded Framework from cache' + id: cef-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'cef-cache' + with: + path: ${{ github.workspace }}/cmbuild/cef_binary_${{ env.LINUX_CEF_BUILD_VERSION }}_linux64 + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.LINUX_CEF_BUILD_VERSION }} + - name: 'Install prerequisite: Chromium Embedded Framework' + if: steps.cef-cache.outputs.cache-hit != 'true' + shell: bash + run: | + curl -kL https://cdn-fastly.obsproject.com/downloads/cef_binary_${{ env.LINUX_CEF_BUILD_VERSION }}_linux64.tar.bz2 -f --retry 5 -o cef.tar.bz2 + if [ ! -d "${{ github.workspace }}/cmbuild" ]; then mkdir "${{ github.workspace }}/cmbuild"; fi + tar -C"${{ github.workspace }}/cmbuild" -xjf cef.tar.bz2 + - name: 'Configure' + shell: bash + run: | + mkdir ./build + cd ./build + cmake -DUNIX_STRUCTURE=0 -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/obs-studio-portable" -DENABLE_UNIT_TESTS=ON -DENABLE_VLC=ON -DWITH_RTMPS=ON -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/cef_binary_${{ env.LINUX_CEF_BUILD_VERSION }}_linux64" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' .. + - name: 'Build' + shell: bash + working-directory: ${{ github.workspace }}/build + run: make -j${NPROC:-4} + - name: 'Test' + shell: bash + working-directory: ${{ github.workspace }}/build + run: make CTEST_OUTPUT_ON_FAILURE=1 test + - name: 'Package' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + shell: bash + run: | + FILE_DATE=$(date +%Y-%m-%d) + FILE_NAME=$FILE_DATE-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-linux64.tar.gz + echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV + cd ./build + sudo checkinstall --default --install=no --pkgname=obs-studio --fstrans=yes --backup=no --pkgversion="$(date +%Y%m%d)-git" --deldoc=yes + mkdir ../nightly + tar -cvzf "${FILE_NAME}" *.deb + mv "${FILE_NAME}" ../nightly/ + cd - + - name: 'Publish' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + uses: actions/upload-artifact@v2.2.0 + with: + name: '${{ env.FILE_NAME }}' + path: './nightly/*.tar.gz' + win64: + name: 'Windows 64-bit' + runs-on: [windows-latest] + env: + QT_VERSION: '5.15.2' + CMAKE_GENERATOR: "Visual Studio 16 2019" + CMAKE_SYSTEM_VERSION: "10.0.18363.657" + WINDOWS_DEPS_VERSION: '2019' + VLC_VERSION: '3.0.0-git' + VIRTUALCAM-GUID: "A3FCE0F5-3493-419F-958A-ABA1250EC20B" + steps: + - name: 'Add msbuild to PATH' + uses: microsoft/setup-msbuild@v1.0.2 + - name: 'Checkout' + uses: actions/checkout@v2.3.3 + with: + submodules: 'recursive' + - name: 'Fetch Git Tags' + shell: bash + run: | + git fetch --prune --unshallow + echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV + echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: 'Check for Github Labels' + if: github.event_name == 'pull_request' + shell: bash + run: | + LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')" + LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)" + if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then + echo "SEEKING_TESTERS=1" >> $GITHUB_ENV + else + echo "SEEKING_TESTERS=0" >> $GITHUB_ENV + fi + - name: 'Restore QT dependency from cache' + id: qt-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'windows-qt-cache' + with: + path: ${{ github.workspace }}/cmbuild/QT + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.QT_VERSION }} + - name: 'Restore pre-built dependencies from cache' + id: deps-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'windows-deps-cache' + with: + path: ${{ github.workspace }}/cmbuild/deps + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.WINDOWS_DEPS_VERSION }} + - name: 'Restore VLC dependency from cache' + id: vlc-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'windows-vlc-cache' + with: + path: ${{ github.workspace }}/cmbuild/vlc + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION }} + - name: 'Restore CEF dependency from cache (64 bit)' + id: cef-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'windows-cef-64-cache' + with: + path: ${{ github.workspace }}/cmbuild/cef_binary_${{ env.CEF_VERSION }}_windows64_minimal + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_VERSION }} + - name: 'Install prerequisite: QT' + if: steps.qt-cache.outputs.cache-hit != 'true' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - + 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}/cmbuild/QT" + - name: 'Install prerequisite: Pre-built dependencies' + if: steps.deps-cache.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: 'Install prerequisite: VLC' + if: steps.vlc-cache.outputs.cache-hit != 'true' + run: | + curl -kL https://cdn-fastly.obsproject.com/downloads/vlc.zip -f --retry 5 -o vlc.zip + 7z x vlc.zip -o"${{ github.workspace }}/cmbuild/vlc" + - name: 'Install prerequisite: Chromium Embedded Framework' + if: steps.cef-cache.outputs.cache-hit != 'true' + run: | + curl -kL https://cdn-fastly.obsproject.com/downloads/cef_binary_${{ env.CEF_VERSION }}_windows64_minimal.zip -f --retry 5 -o cef.zip + 7z x cef.zip -o"${{ github.workspace }}/cmbuild" + - name: 'Configure' + run: | + mkdir ./build + mkdir ./build64 + cd ./build64 + cmake -G"${{ env.CMAKE_GENERATOR }}" -A"x64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=true -DCOMPILE_D3D12_HOOK=true -DVLCPath="${{ github.workspace }}/cmbuild/vlc" -DDepsPath="${{ github.workspace }}/cmbuild/deps/win64" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019_64" -DENABLE_VLC=ON -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/cef_binary_${{ env.CEF_VERSION }}_windows64_minimal" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE -DVIRTUALCAM_GUID=${{ env.VIRTUALCAM-GUID }} .. + - name: 'Build' + run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-studio.sln + - name: 'Package' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + run: | + $env:FILE_DATE=(Get-Date -UFormat "%F") + $env:FILE_NAME="${env:FILE_DATE}-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-win64.zip" + echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV} + robocopy .\build64\rundir\RelWithDebInfo .\build\ /E /XF .gitignore + 7z a ${env:FILE_NAME} .\build\* + - name: 'Publish' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + uses: actions/upload-artifact@v2.2.0 + with: + name: '${{ env.FILE_NAME }}' + path: '*-win64.zip' + win32: + name: 'Windows 32-bit' + runs-on: [windows-latest] + env: + QT_VERSION: '5.15.2' + CMAKE_GENERATOR: "Visual Studio 16 2019" + CMAKE_SYSTEM_VERSION: "10.0.18363.657" + WINDOWS_DEPS_VERSION: '2019' + VIRTUALCAM-GUID: "A3FCE0F5-3493-419F-958A-ABA1250EC20B" steps: - - uses: actions/checkout@v2 - - name: update repo - run: sudo apt-get update - - name: install deps - run: sudo apt-get install \ - build-essential \ - checkinstall \ - cmake \ - git \ - libmbedtls-dev \ - libasound2-dev \ - libavcodec-dev \ - libavdevice-dev \ - libavfilter-dev \ - libavformat-dev \ - libavutil-dev \ - libcurl4-openssl-dev \ - libfdk-aac-dev \ - libfontconfig-dev \ - libfreetype6-dev \ - libgl1-mesa-dev \ - libjack-jackd2-dev \ - libjansson-dev \ - libluajit-5.1-dev \ - libpulse-dev \ - libqt5x11extras5-dev \ - libspeexdsp-dev \ - libswresample-dev \ - libswscale-dev \ - libudev-dev \ - libv4l-dev \ - libvlc-dev \ - libx11-dev \ - libx264-dev \ - libxcb-shm0-dev \ - libxcb-xinerama0-dev \ - libxcomposite-dev \ - libxinerama-dev \ - pkg-config \ - python3-dev \ - qtbase5-dev \ - libqt5svg5-dev \ - swig \ - libxcb-randr0-dev \ - libxcb-xfixes0-dev \ - libx11-xcb-dev \ - libxcb1-dev \ - libxss-dev - - - name: Create Build Environment - run: sudo apt install libnss3-dev - - name: Create Build Environment - run: wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4280_linux64.tar.bz2 - - name: Create Build Environment - run: tar -xjf ./cef_binary_4280_linux64.tar.bz2 - - name: Create Build Environment - run: git clone --recursive https://github.com/obsproject/obs-studio.git - - name: Create Build Environment - run: cd obs-studio - - name: Create Build Environment - run: mkdir build && cd build - - name: Create Build Environment - run: cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4280_linux64" .. - - name: Create Build Environment - run: make -j4 - - name: Create Build Environment - run: sudo checkinstall --default --pkgname=obs-studio --fstrans=no --backup=no --pkgversion="$(date +%Y%m%d)-git" --deldoc=yes - - name: Create Build Environment - # Some projects don't allow in-source building, so create a separate build directory - # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{github.workspace}}/build - - - name: Configure CMake - # Use a bash shell so we can use the same syntax for environment variable - # access regardless of the host operating system - shell: bash - working-directory: ${{github.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build - working-directory: ${{github.workspace}}/build - shell: bash - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config $BUILD_TYPE - - - name: Test - working-directory: ${{github.workspace}}/build - shell: bash - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C $BUILD_TYPE + - name: 'Add msbuild to PATH' + uses: microsoft/setup-msbuild@v1.0.2 + - name: 'Checkout' + uses: actions/checkout@v2.3.3 + with: + submodules: 'recursive' + - name: 'Fetch Git Tags' + shell: bash + run: | + git fetch --prune --unshallow + echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV + echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: 'Check for Github Labels' + if: github.event_name == 'pull_request' + shell: bash + run: | + LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')" + LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)" + if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then + echo "SEEKING_TESTERS=1" >> $GITHUB_ENV + else + echo "SEEKING_TESTERS=0" >> $GITHUB_ENV + fi + - name: 'Restore QT dependency from cache' + id: qt-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'qt-cache' + with: + path: ${{ github.workspace }}/cmbuild/QT + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.QT_VERSION }} + - name: 'Restore pre-built dependencies from cache' + id: deps-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'deps-cache' + with: + path: ${{ github.workspace }}/cmbuild/deps + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.WINDOWS_DEPS_VERSION }} + - name: 'Restore VLC dependency from cache' + id: vlc-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'vlc-cache' + with: + path: ${{ github.workspace }}/cmbuild/vlc + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.WINDOWS_VLC_VERSION }} + - name: 'Restore CEF dependency from cache (32 bit)' + id: cef-cache + uses: actions/cache@v2.1.2 + env: + CACHE_NAME: 'cef-32-cache' + with: + path: ${{ github.workspace }}/cmbuild/cef_binary_${{ env.CEF_VERSION }}_windows32_minimal + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_VERSION }} + - name: 'Install prerequisite: QT' + if: steps.qt-cache.outputs.cache-hit != 'true' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - + 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}/cmbuild/QT" + - name: 'Install prerequisite: Pre-built dependencies' + if: steps.deps-cache.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: 'Install prerequisite: VLC' + if: steps.vlc-cache.outputs.cache-hit != 'true' + run: | + curl -kL https://cdn-fastly.obsproject.com/downloads/vlc.zip -f --retry 5 -o vlc.zip + 7z x vlc.zip -o"${{ github.workspace }}/cmbuild/vlc" + - name: 'Install prerequisite: Chromium Embedded Framework' + if: steps.cef-cache.outputs.cache-hit != 'true' + run: | + curl -kL https://cdn-fastly.obsproject.com/downloads/cef_binary_${{ env.CEF_VERSION }}_windows32_minimal.zip -f --retry 5 -o cef.zip + 7z x cef.zip -o"${{ github.workspace }}/cmbuild" + - name: 'Configure' + run: | + mkdir ./build + mkdir ./build32 + cd ./build32 + cmake -G"${{ env.CMAKE_GENERATOR }}" -A"Win32" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DENABLE_VLC=ON -DBUILD_BROWSER=true -DCOMPILE_D3D12_HOOK=true -DVLCPath="${{ github.workspace }}/cmbuild/vlc" -DDepsPath="${{ github.workspace }}/cmbuild/deps/win32" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019" -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/cef_binary_${{ env.CEF_VERSION }}_windows32_minimal" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE -DVIRTUALCAM_GUID=${{ env.VIRTUALCAM-GUID }} .. + - name: 'Build' + run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-studio.sln + - name: 'Package' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + run: | + $env:FILE_DATE=(Get-Date -UFormat "%F") + $env:FILE_NAME="${env:FILE_DATE}-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-win32.zip" + echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV} + robocopy .\build32\rundir\RelWithDebInfo .\build\ /E /XF .gitignore + 7z a ${env:FILE_NAME} .\build\* + - name: 'Publish' + if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + uses: actions/upload-artifact@v2.2.0 + with: + name: '${{ env.FILE_NAME }}' + path: '*-win32.zip' From 105d67d3f2f069fccee7c1c3baed5ac53df2c94c Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 04:06:49 -0500 Subject: [PATCH 05/53] Update cmake.yml --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 160dfad9..297b6290 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,6 +22,7 @@ env: TWITCH_HASH: ${{ secrets.TWITCH_HASH }} RESTREAM_CLIENTID: ${{ secrets.RESTREAM_CLIENTID }} RESTREAM_HASH: ${{ secrets.RESTREAM_HASH }} + isAzure: true jobs: macos64: From 8bfad6a6dc9bd9eb927c75040dfc1f2cb2e1640c Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 04:09:38 -0500 Subject: [PATCH 06/53] Update cmake.yml --- .github/workflows/cmake.yml | 327 +----------------------------------- 1 file changed, 1 insertion(+), 326 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 297b6290..4d275523 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -25,332 +25,7 @@ env: isAzure: true jobs: - macos64: - name: 'macOS 64-bit' - runs-on: [macos-latest] - env: - MIN_MACOS_VERSION: '10.13' - MACOS_DEPS_VERSION: '2020-12-22' - VLC_VERSION: '3.0.8' - SPARKLE_VERSION: '1.23.0' - QT_VERSION: '5.15.2' - SIGN_IDENTITY: '' - steps: - - name: 'Checkout' - uses: actions/checkout@v2.3.3 - with: - submodules: 'recursive' - - name: 'Fetch Git Tags' - run: | - git fetch --prune --unshallow - echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV - echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - - name: 'Check for Github Labels' - if: github.event_name == 'pull_request' - run: | - LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')" - LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)" - if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then - echo "SEEKING_TESTERS=1" >> $GITHUB_ENV - else - echo "SEEKING_TESTERS=0" >> $GITHUB_ENV - fi - - name: 'Setup build environment (Homebrew + ENV)' - shell: bash - run: | - if [ -d /usr/local/opt/openssl@1.0.2t ]; then - brew uninstall openssl@1.0.2t - brew untap local/openssl - fi - - if [ -d /usr/local/opt/python@2.7.17 ]; then - brew uninstall python@2.7.17 - brew untap local/python2 - fi - - if [ -d /usr/local/opt/speexdsp ]; then - brew unlink speexdsp - fi - brew uninstall curl php - brew bundle --file ./CI/scripts/macos/Brewfile - echo "NPROC=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - - name: 'Restore Chromium Embedded Framework from cache' - id: cef-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'cef-cache' - with: - path: ${{ github.workspace }}/cmbuild/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64 - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.MACOS_CEF_BUILD_VERSION }} - - name: 'Restore VLC dependency from cache' - id: vlc-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'vlc-cache' - with: - path: ${{ github.workspace }}/cmbuild/vlc-${{ env.VLC_VERSION }} - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION }} - - name: 'Restore Sparkle dependency from cache' - id: sparkle-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'sparkle-cache' - with: - path: ${{ github.workspace }}/cmbuild/sparkle - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.SPARKLE_VERSION }} - - name: 'Install prerequisite: Pre-built 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 }}.tar.gz - tar -xf ./macos-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp" - - name: 'Install prerequisite: Pre-built dependency Qt' - if: steps.deps-qt-cache.outputs.cache-hit != 'true' - shell: bash - run: | - 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 - tar -xf ./macos-qt-${{ env.QT_VERSION }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp" - xattr -r -d com.apple.quarantine /tmp/obsdeps - - name: 'Install prerequisite: VLC' - if: steps.vlc-cache.outputs.cache-hit != 'true' - shell: bash - run: | - curl -L -O https://downloads.videolan.org/vlc/${{ env.VLC_VERSION }}/vlc-${{ env.VLC_VERSION }}.tar.xz - if [ ! -d "${{ github.workspace }}/cmbuild" ]; then mkdir "${{ github.workspace }}/cmbuild"; fi - tar -xf ./vlc-${{ env.VLC_VERSION }}.tar.xz -C "${{ github.workspace }}/cmbuild" - - name: 'Install prerequisite: Sparkle' - if: steps.sparkle-cache.outputs.cache-hit != 'true' - shell: bash - run: | - curl -L -o sparkle.tar.bz2 https://github.com/sparkle-project/Sparkle/releases/download/${{ env.SPARKLE_VERSION }}/Sparkle-${{ env.SPARKLE_VERSION }}.tar.bz2 - mkdir ${{ github.workspace }}/cmbuild/sparkle - tar -xf ./sparkle.tar.bz2 -C ${{ github.workspace }}/cmbuild/sparkle - - name: 'Setup prerequisite: Sparkle' - shell: bash - run: sudo cp -R ${{ github.workspace }}/cmbuild/sparkle/Sparkle.framework /Library/Frameworks/Sparkle.framework - - name: 'Install prerequisite: Chromium Embedded Framework' - if: steps.cef-cache.outputs.cache-hit != 'true' - shell: bash - run: | - curl -L -O https://cdn-fastly.obsproject.com/downloads/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64.tar.bz2 - tar -xf ./cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64.tar.bz2 -C ${{ github.workspace }}/cmbuild/ - cd ${{ github.workspace }}/cmbuild/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64 - /usr/bin/sed -i '.orig' '/add_subdirectory(tests\/ceftests)/d' ./CMakeLists.txt - /usr/bin/sed -i '.orig' s/\"10.9\"/\"${{ env.MIN_MACOS_VERSION }}\"/ ./cmake/cef_variables.cmake - mkdir build && cd build - cmake -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -Wno-deprecated-declarations" -DCMAKE_EXE_LINKER_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MIN_MACOS_VERSION }} .. - make -j${NPROC:-4} - mkdir libcef_dll - cd ../../ - - name: 'Configure' - shell: bash - run: | - mkdir ./build - cd ./build - LEGACY_BROWSER="$(test "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 && echo "ON" || echo "OFF")" - cmake -DENABLE_UNIT_TESTS=YES -DENABLE_SPARKLE_UPDATER=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MIN_MACOS_VERSION }} -DQTDIR="/tmp/obsdeps" -DSWIGDIR="/tmp/obsdeps" -DDepsPath="/tmp/obsdeps" -DVLCPath="${{ github.workspace }}/cmbuild/vlc-${{ env.VLC_VERSION }}" -DENABLE_VLC=ON -DBUILD_BROWSER=ON -DBROWSER_LEGACY=$LEGACY_BROWSER -DWITH_RTMPS=ON -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' .. - - name: 'Build' - shell: bash - working-directory: ${{ github.workspace }}/build - run: make -j${NPROC:-4} - - name: 'Test' - shell: bash - working-directory: ${{ github.workspace }}/build - run: make CTEST_OUTPUT_ON_FAILURE=1 test - - name: 'Install prerequisite: DMGbuild' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - shell: bash - run: | - pip3 install dmgbuild - - name: 'Install Apple Developer Certificate' - if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' - uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071 - with: - p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }} - p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }} - - name: 'Set Signing Identity' - if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' - run: | - echo "SIGN_IDENTITY=${{ secrets.MACOS_SIGNING_IDENTITY }}" >> $GITHUB_ENV - - name: 'Create macOS application bundle' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - working-directory: ${{ github.workspace }}/build - shell: bash - run: | - if [ -d ./OBS.app ]; then rm -rf ./OBS.app; fi - mkdir -p OBS.app/Contents/MacOS - mkdir OBS.app/Contents/PlugIns - mkdir OBS.app/Contents/Resources - mkdir OBS.app/Contents/Frameworks - - cp rundir/RelWithDebInfo/bin/obs ./OBS.app/Contents/MacOS - cp rundir/RelWithDebInfo/bin/obs-ffmpeg-mux ./OBS.app/Contents/MacOS - if ! [ "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 ]; then - cp -R "rundir/RelWithDebInfo/bin/OBS Helper.app" "./OBS.app/Contents/Frameworks/OBS Helper.app" - cp -R "rundir/RelWithDebInfo/bin/OBS Helper (GPU).app" "./OBS.app/Contents/Frameworks/OBS Helper (GPU).app" - cp -R "rundir/RelWithDebInfo/bin/OBS Helper (Plugin).app" "./OBS.app/Contents/Frameworks/OBS Helper (Plugin).app" - cp -R "rundir/RelWithDebInfo/bin/OBS Helper (Renderer).app" "./OBS.app/Contents/Frameworks/OBS Helper (Renderer).app" - fi - cp rundir/RelWithDebInfo/bin/libobsglad.0.dylib ./OBS.app/Contents/MacOS - cp -R rundir/RelWithDebInfo/data ./OBS.app/Contents/Resources - cp ../CI/scripts/macos/app/AppIcon.icns ./OBS.app/Contents/Resources - cp -R rundir/RelWithDebInfo/obs-plugins/ ./OBS.app/Contents/PlugIns - cp ../CI/scripts/macos/app/Info.plist ./OBS.app/Contents - - if [ -d ./OBS.app/Contents/Resources/data/obs-scripting ]; then - mv ./OBS.app/Contents/Resources/data/obs-scripting/obslua.so ./OBS.app/Contents/MacOS/ - mv ./OBS.app/Contents/Resources/data/obs-scripting/_obspython.so ./OBS.app/Contents/MacOS/ - mv ./OBS.app/Contents/Resources/data/obs-scripting/obspython.py ./OBS.app/Contents/MacOS/ - rm -rf ./OBS.app/Contents/Resources/data/obs-scripting/ - fi - - BUNDLE_PLUGINS=( - ./OBS.app/Contents/PlugIns/coreaudio-encoder.so - ./OBS.app/Contents/PlugIns/decklink-ouput-ui.so - ./OBS.app/Contents/PlugIns/decklink-captions.so - ./OBS.app/Contents/PlugIns/frontend-tools.so - ./OBS.app/Contents/PlugIns/image-source.so - ./OBS.app/Contents/PlugIns/mac-avcapture.so - ./OBS.app/Contents/PlugIns/mac-capture.so - ./OBS.app/Contents/PlugIns/mac-decklink.so - ./OBS.app/Contents/PlugIns/mac-syphon.so - ./OBS.app/Contents/PlugIns/mac-vth264.so - ./OBS.app/Contents/PlugIns/mac-virtualcam.so - ./OBS.app/Contents/PlugIns/obs-browser.so - ./OBS.app/Contents/PlugIns/obs-ffmpeg.so - ./OBS.app/Contents/PlugIns/obs-filters.so - ./OBS.app/Contents/PlugIns/obs-transitions.so - ./OBS.app/Contents/PlugIns/obs-vst.so - ./OBS.app/Contents/PlugIns/rtmp-services.so - ./OBS.app/Contents/MacOS/obs-ffmpeg-mux - ./OBS.app/Contents/MacOS/obslua.so - ./OBS.app/Contents/MacOS/_obspython.so - ./OBS.app/Contents/PlugIns/obs-x264.so - ./OBS.app/Contents/PlugIns/text-freetype2.so - ./OBS.app/Contents/PlugIns/obs-outputs.so - ) - - if ! [ "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 ]; then - ../CI/scripts/macos/app/dylibBundler -cd -of -a ./OBS.app -q -f \ - -s ./OBS.app/Contents/MacOS \ - -s "${{ github.workspace }}/cmbuild/sparkle/Sparkle.framework" \ - -s ./rundir/RelWithDebInfo/bin \ - $(echo "${BUNDLE_PLUGINS[@]/#/-x }") - else - ../CI/scripts/macos/app/dylibBundler -cd -of -a ./OBS.app -q -f \ - -s ./OBS.app/Contents/MacOS \ - -s "${{ github.workspace }}/cmbuild/sparkle/Sparkle.framework" \ - -s ./rundir/RelWithDebInfo/bin \ - $(echo "${BUNDLE_PLUGINS[@]/#/-x }") \ - -x ./OBS.app/Contents/PlugIns/obs-browser-page - fi - - mv ./libobs-opengl/libobs-opengl.so ./OBS.app/Contents/Frameworks - - cp -R /tmp/obsdeps/lib/QtNetwork.framework ./OBS.app/Contents/Frameworks - chmod -R +w ./OBS.app/Contents/Frameworks/QtNetwork.framework - rm -r ./OBS.app/Contents/Frameworks/QtNetwork.framework/Headers - rm -r ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/Headers/ - chmod 644 ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/Resources/Info.plist - install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork - install_name_tool -change /tmp/obsdeps/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork - - cp -R "${{ github.workspace }}/cmbuild/cef_binary_${{ env.MACOS_CEF_BUILD_VERSION }}_macosx64/Release/Chromium Embedded Framework.framework" ./OBS.app/Contents/Frameworks/ - chown -R $(whoami) ./OBS.app/Contents/Frameworks/ - - cp ../CI/scripts/macos/app/OBSPublicDSAKey.pem ./OBS.app/Contents/Resources - - if [ "${GITHUB_REF:0:10}" = "refs/tags/" ]; then - plutil -insert CFBundleVersion -string ${{ env.OBS_GIT_TAG }} ./OBS.app/Contents/Info.plist - plutil -insert CFBundleShortVersionString -string ${{ env.OBS_GIT_TAG }} ./OBS.app/Contents/Info.plist - else - plutil -insert CFBundleVersion -string ${{ env.OBS_GIT_TAG }}-${{ env.OBS_GIT_HASH }} ./OBS.app/Contents/Info.plist - plutil -insert CFBundleShortVersionString -string ${{ env.OBS_GIT_TAG }}-${{ env.OBS_GIT_HASH }} ./OBS.app/Contents/Info.plist - fi - - plutil -insert OBSFeedsURL -string https://obsproject.com/osx_update/feeds.xml ./OBS.app/Contents/Info.plist - plutil -insert SUFeedURL -string https://obsproject.com/osx_update/stable/updates.xml ./OBS.app/Contents/Info.plist - plutil -insert SUPublicDSAKeyFile -string OBSPublicDSAKey.pem ./OBS.app/Contents/Info.plist - - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop" - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate" - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" --deep ./OBS.app/Contents/Frameworks/Sparkle.framework - - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libEGL.dylib" - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libswiftshader_libEGL.dylib" - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib" - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libswiftshader_libGLESv2.dylib" - if ! [ "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 ]; then - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libvk_swiftshader.dylib" - fi - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework" - - codesign --force --options runtime --deep --sign "${SIGN_IDENTITY:--}" "./OBS.app/Contents/Resources/data/obs-mac-virtualcam.plugin" - - codesign --force --options runtime --entitlements "../CI/scripts/macos/app/entitlements.plist" --sign "${SIGN_IDENTITY:--}" --deep ./OBS.app - - if ! [ "${{ env.MACOS_CEF_BUILD_VERSION }}" -le 3770 ]; then - codesign --force --options runtime --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/OBS Helper.app" - codesign --force --options runtime --entitlements "../CI/scripts/macos/helpers/helper-gpu-entitlements.plist" --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (GPU).app" - codesign --force --options runtime --entitlements "../CI/scripts/macos/helpers/helper-plugin-entitlements.plist" --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (Plugin).app" - codesign --force --options runtime --entitlements "../CI/scripts/macos/helpers/helper-renderer-entitlements.plist" --sign "${SIGN_IDENTITY:--}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (Renderer).app" - fi - - codesign -dvv ./OBS.app - - name: 'Package' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - working-directory: ${{ github.workspace }}/build - shell: bash - run: | - FILE_DATE=$(date +%Y-%m-%d) - FILE_NAME=$FILE_DATE-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-macOS.dmg - echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV - - cp ../CI/scripts/macos/package/settings.json.template ./settings.json - /usr/bin/sed -i '' 's#\$\$VERSION\$\$#${{ env.OBS_GIT_TAG }}#g' ./settings.json - /usr/bin/sed -i '' 's#\$\$CI_PATH\$\$#../CI/scripts/macos#g' ./settings.json - /usr/bin/sed -i '' 's#\$\$BUNDLE_PATH\$\$#${{ github.workspace }}/build#g' ./settings.json - - dmgbuild "OBS-Studio ${{ env.OBS_GIT_TAG }}" "${FILE_NAME}" -s ./settings.json - mkdir ../nightly - codesign --force --sign "${SIGN_IDENTITY:--}" ./"${FILE_NAME}" - codesign -dvv ./"${FILE_NAME}" - sudo cp ./${FILE_NAME} ../nightly/${FILE_NAME} - - name: 'Publish' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - uses: actions/upload-artifact@v2.2.0 - with: - name: '${{ env.FILE_NAME }}' - path: ./nightly/*.dmg - - name: 'Package Release' - if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' - working-directory: ${{ github.workspace }}/build - shell: bash - run: | - FILE_DATE=$(date +%Y-%m-%d) - FILE_NAME=$FILE_DATE-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-macOS.dmg - RELEASE_FILE_NAME=$FILE_DATE-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-rel-macOS.dmg - echo "RELEASE_FILE_NAME=${RELEASE_FILE_NAME}" >> $GITHUB_ENV - - xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.MACOS_NOTARIZATION_USERNAME }}" -p "${{ secrets.MACOS_NOTARIZATION_PASSWORD }}" - - xcnotary precheck "./OBS.app" - - if [ "$?" -eq 0 ]; then - xcnotary notarize "$FILE_NAME" --developer-account "${{ secrets.MACOS_NOTARIZATION_USERNAME }}" --developer-password-keychain-item "AC_PASSWORD" --provider "${{ secrets.ASC_PROVIDER_SHORTNAME }}" - else - return 1 - fi - - mkdir ../release - sudo mv ./$FILE_NAME ../release/$RELEASE_FILE_NAME - - name: 'Publish Release' - if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' - uses: actions/upload-artifact@v2.2.0 - with: - name: '${{ env.RELEASE_FILE_NAME }}' - path: ./release/*.dmg + ubuntu64: name: 'Linux/Ubuntu 64-bit' runs-on: [ubuntu-latest] From eb465403be369f5058d70452e0736c30fcc9905a Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 04:10:58 -0500 Subject: [PATCH 07/53] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdee5d3e..09f95f42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,7 +279,7 @@ endif() # -- Fixes issue where plugin isn't copied to rundir plugins directory on local build -- if(WIN32) if (${isAzure}) - else () + install_obs_plugin_with_data(obs-midi data) endif() endif() From 50a04b3f19b3f9ab2b72ef824c1efd9e62e1fc17 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:19:00 -0500 Subject: [PATCH 08/53] Update cmake.yml --- .github/workflows/cmake.yml | 578 +++++++++++++++++++----------------- 1 file changed, 310 insertions(+), 268 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4d275523..eefc4521 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -3,57 +3,194 @@ name: 'CI Multiplatform Build' on: push: paths-ignore: - - '**.md' - branches: - - master - tags: - - '*' + - 'docs/**' pull_request: paths-ignore: - '**.md' - branches: - - master -env: - MACOS_CEF_BUILD_VERSION: '4183' - LINUX_CEF_BUILD_VERSION: '4280' - CEF_VERSION: '75.1.16+g16a67c4+chromium-75.0.3770.100' - TWITCH_CLIENTID: ${{ secrets.TWITCH_CLIENT_ID }} - TWITCH_HASH: ${{ secrets.TWITCH_HASH }} - RESTREAM_CLIENTID: ${{ secrets.RESTREAM_CLIENTID }} - RESTREAM_HASH: ${{ secrets.RESTREAM_HASH }} - isAzure: true jobs: - + windows: + name: 'Windows 32+64bit' + runs-on: [windows-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true + env: + QT_VERSION: '5.10.1' + WINDOWS_DEPS_VERSION: '2017' + CMAKE_GENERATOR: "Visual Studio 16 2019" + CMAKE_SYSTEM_VERSION: "10.0" + steps: + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.0 + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-midi + submodules: 'recursive' + - name: 'Checkout OBS' + 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 ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - 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-midi git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-midi + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisite: QT' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - + 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT" + - name: 'Install prerequisite: Pre-built OBS dependencies' + 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 32-bit build v${{ env.OBS_GIT_TAG }} from cache' + id: build-cache-obs-32 + uses: actions/cache@v1 + 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 32-bit' + if: steps.build-cache-obs-32.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir .\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 }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + - 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 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 64-bit' + if: steps.build-cache-obs-64.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir .\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 }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + - 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-midi 64-bit' + working-directory: ${{ github.workspace }}/obs-midi + run: | + mkdir .\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 }}\msvc2017_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" .. + - name: 'Configure obs-midi 32-bit' + working-directory: ${{ github.workspace }}/obs-midi + run: | + mkdir .\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 }}\msvc2017" -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" .. + - name: 'Build obs-midi 64-bit' + working-directory: ${{ github.workspace }}/obs-midi + run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-midi.sln + - name: 'Build obs-midi 32-bit' + working-directory: ${{ github.workspace }}/obs-midi + run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-midi.sln + - name: 'Set PR artifact filename' + shell: bash + run: | + FILENAME="obs-midi-${{ env.GIT_HASH }}-Windows" + echo "::set-env name=FILENAME::$FILENAME" + - name: 'Package obs-midi' + working-directory: ${{ github.workspace }}/obs-midi + 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: '${{ env.GIT_HASH }}-Windows' + path: ${{ github.workspace }}/obs-midi/package/*.zip + - name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-Windows-Installer' + path: ${{ github.workspace }}/obs-midi/package/*.exe ubuntu64: - name: 'Linux/Ubuntu 64-bit' + name: "Linux/Ubuntu 64-bit" runs-on: [ubuntu-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true steps: - name: 'Checkout' - uses: actions/checkout@v2.3.3 + uses: actions/checkout@v2 with: + path: ${{ github.workspace }}/obs-midi submodules: 'recursive' - - name: 'Fetch Git Tags' + - name: 'Checkout OBS' + 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_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV - echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - - name: 'Check for Github Labels' - if: github.event_name == 'pull_request' - run: | - LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')" - LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)" - if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then - echo "SEEKING_TESTERS=1" >> $GITHUB_ENV - else - echo "SEEKING_TESTERS=0" >> $GITHUB_ENV - fi - - name: Install prerequisites (Apt) + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - 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-midi git info' + working-directory: ${{ github.workspace }}/obs-midi + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisites (Apt)' shell: bash run: | - echo "NPROC=$(($(nproc)+1))" >> $GITHUB_ENV sudo dpkg --add-architecture amd64 sudo apt-get -qq update sudo apt-get install -y \ @@ -76,7 +213,6 @@ jobs: libluajit-5.1-dev \ libpulse-dev \ libqt5x11extras5-dev \ - libsndio-dev \ libspeexdsp-dev \ libswresample-dev \ libswscale-dev \ @@ -96,272 +232,178 @@ jobs: python3-dev \ qtbase5-dev \ libqt5svg5-dev \ - swig \ - libcmocka-dev \ - linux-generic \ - v4l2loopback-dkms - - name: 'Restore Chromium Embedded Framework from cache' - id: cef-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'cef-cache' - with: - path: ${{ github.workspace }}/cmbuild/cef_binary_${{ env.LINUX_CEF_BUILD_VERSION }}_linux64 - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.LINUX_CEF_BUILD_VERSION }} - - name: 'Install prerequisite: Chromium Embedded Framework' - if: steps.cef-cache.outputs.cache-hit != 'true' + swig + - name: 'Configure OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio shell: bash run: | - curl -kL https://cdn-fastly.obsproject.com/downloads/cef_binary_${{ env.LINUX_CEF_BUILD_VERSION }}_linux64.tar.bz2 -f --retry 5 -o cef.tar.bz2 - if [ ! -d "${{ github.workspace }}/cmbuild" ]; then mkdir "${{ github.workspace }}/cmbuild"; fi - tar -C"${{ github.workspace }}/cmbuild" -xjf cef.tar.bz2 - - name: 'Configure' + mkdir ./build + cd ./build + cmake -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + set -e + cd ./build + make -j4 libobs obs-frontend-api + - name: 'Install OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + cd ./build + sudo cp ./libobs/libobs.so /usr/lib + sudo cp ./UI/obs-frontend-api/libobs-frontend-api.so /usr/lib + sudo mkdir -p /usr/include/obs + sudo cp ../UI/obs-frontend-api/obs-frontend-api.h /usr/include/obs/obs-frontend-api.h + - name: 'Configure obs-midi' + working-directory: ${{ github.workspace }}/obs-midi shell: bash run: | mkdir ./build cd ./build - cmake -DUNIX_STRUCTURE=0 -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/obs-studio-portable" -DENABLE_UNIT_TESTS=ON -DENABLE_VLC=ON -DWITH_RTMPS=ON -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/cef_binary_${{ env.LINUX_CEF_BUILD_VERSION }}_linux64" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' .. - - name: 'Build' + cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build obs-midi' + working-directory: ${{ github.workspace }}/obs-midi shell: bash - working-directory: ${{ github.workspace }}/build - run: make -j${NPROC:-4} - - name: 'Test' + run: | + set -e + cd ./build + make -j4 + - name: 'Set PR artifact filename' shell: bash - working-directory: ${{ github.workspace }}/build - run: make CTEST_OUTPUT_ON_FAILURE=1 test - - name: 'Package' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') + run: | + FILENAME="obs-midi-1-${{ env.GIT_HASH }}-1_amd64.deb" + echo "::set-env name=FILENAME::$FILENAME" + - name: 'Package ${{ env.FILENAME }}' + if: success() + working-directory: ${{ github.workspace }}/obs-midi shell: bash run: | - FILE_DATE=$(date +%Y-%m-%d) - FILE_NAME=$FILE_DATE-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-linux64.tar.gz - echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV + VERSION="1-${{ env.GIT_HASH }}-git" cd ./build - sudo checkinstall --default --install=no --pkgname=obs-studio --fstrans=yes --backup=no --pkgversion="$(date +%Y%m%d)-git" --deldoc=yes - mkdir ../nightly - tar -cvzf "${FILE_NAME}" *.deb - mv "${FILE_NAME}" ../nightly/ + sudo checkinstall -y --type=debian --fstrans=no -nodoc \ + --backup=no --deldoc=yes --install=no --pkgname=obs-midi --pkgversion=$VERSION \ + --pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \ + --pkgsource="${{ github.event.repository.html_url }}" \ + --requires="obs-studio,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \ + --pakdir="../package" + sudo chmod ao+r ../package/* cd - - - name: 'Publish' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - uses: actions/upload-artifact@v2.2.0 + - name: 'Publish ${{ env.FILENAME }}' + if: success() + uses: actions/upload-artifact@v2-preview with: - name: '${{ env.FILE_NAME }}' - path: './nightly/*.tar.gz' - win64: - name: 'Windows 64-bit' - runs-on: [windows-latest] + name: '${{ env.GIT_HASH }}-linux' + path: '${{ github.workspace }}/obs-midi/package/*.deb' + macos64: + name: "macOS 64-bit" + runs-on: [macos-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true env: - QT_VERSION: '5.15.2' - CMAKE_GENERATOR: "Visual Studio 16 2019" - CMAKE_SYSTEM_VERSION: "10.0.18363.657" - WINDOWS_DEPS_VERSION: '2019' - VLC_VERSION: '3.0.0-git' - VIRTUALCAM-GUID: "A3FCE0F5-3493-419F-958A-ABA1250EC20B" + MACOS_DEPS_VERSION: '2020-04-18' + QT_VERSION: '5.14.1' steps: - - name: 'Add msbuild to PATH' - uses: microsoft/setup-msbuild@v1.0.2 - name: 'Checkout' - uses: actions/checkout@v2.3.3 + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-midi + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio submodules: 'recursive' - - name: 'Fetch Git Tags' + - name: 'Get OBS-Studio git info' shell: bash + working-directory: ${{ github.workspace }}/obs-studio run: | git fetch --prune --unshallow - echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV - echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - - name: 'Check for Github Labels' - if: github.event_name == 'pull_request' + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' shell: bash + working-directory: ${{ github.workspace }}/obs-studio run: | - LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')" - LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)" - if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then - echo "SEEKING_TESTERS=1" >> $GITHUB_ENV - else - echo "SEEKING_TESTERS=0" >> $GITHUB_ENV - fi - - name: 'Restore QT dependency from cache' - id: qt-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'windows-qt-cache' - with: - path: ${{ github.workspace }}/cmbuild/QT - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.QT_VERSION }} - - name: 'Restore pre-built dependencies from cache' - id: deps-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'windows-deps-cache' - with: - path: ${{ github.workspace }}/cmbuild/deps - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.WINDOWS_DEPS_VERSION }} - - name: 'Restore VLC dependency from cache' - id: vlc-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'windows-vlc-cache' - with: - path: ${{ github.workspace }}/cmbuild/vlc - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION }} - - name: 'Restore CEF dependency from cache (64 bit)' - id: cef-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'windows-cef-64-cache' - with: - path: ${{ github.workspace }}/cmbuild/cef_binary_${{ env.CEF_VERSION }}_windows64_minimal - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_VERSION }} - - name: 'Install prerequisite: QT' - if: steps.qt-cache.outputs.cache-hit != 'true' + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-midi git info' + working-directory: ${{ github.workspace }}/obs-midi run: | - curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - - 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}/cmbuild/QT" - - name: 'Install prerequisite: Pre-built dependencies' - if: steps.deps-cache.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: 'Install prerequisite: VLC' - if: steps.vlc-cache.outputs.cache-hit != 'true' + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisites (Homebrew)' + shell: bash run: | - curl -kL https://cdn-fastly.obsproject.com/downloads/vlc.zip -f --retry 5 -o vlc.zip - 7z x vlc.zip -o"${{ github.workspace }}/cmbuild/vlc" - - name: 'Install prerequisite: Chromium Embedded Framework' - if: steps.cef-cache.outputs.cache-hit != 'true' + brew bundle --file ${{ github.workspace }}/obs-midi/CI/macos/Brewfile + - name: 'Install prerequisite: Pre-built OBS dependencies' + shell: bash run: | - curl -kL https://cdn-fastly.obsproject.com/downloads/cef_binary_${{ env.CEF_VERSION }}_windows64_minimal.zip -f --retry 5 -o cef.zip - 7z x cef.zip -o"${{ github.workspace }}/cmbuild" - - name: 'Configure' + curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz + tar -xf ${{ github.workspace }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp" + - name: 'Configure OBS Studio' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio run: | - mkdir ./build - mkdir ./build64 - cd ./build64 - cmake -G"${{ env.CMAKE_GENERATOR }}" -A"x64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=true -DCOMPILE_D3D12_HOOK=true -DVLCPath="${{ github.workspace }}/cmbuild/vlc" -DDepsPath="${{ github.workspace }}/cmbuild/deps/win64" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019_64" -DENABLE_VLC=ON -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/cef_binary_${{ env.CEF_VERSION }}_windows64_minimal" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE -DVIRTUALCAM_GUID=${{ env.VIRTUALCAM-GUID }} .. - - name: 'Build' - run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-studio.sln - - name: 'Package' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - run: | - $env:FILE_DATE=(Get-Date -UFormat "%F") - $env:FILE_NAME="${env:FILE_DATE}-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-win64.zip" - echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV} - robocopy .\build64\rundir\RelWithDebInfo .\build\ /E /XF .gitignore - 7z a ${env:FILE_NAME} .\build\* - - name: 'Publish' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - uses: actions/upload-artifact@v2.2.0 - with: - name: '${{ env.FILE_NAME }}' - path: '*-win64.zip' - win32: - name: 'Windows 32-bit' - runs-on: [windows-latest] - env: - QT_VERSION: '5.15.2' - CMAKE_GENERATOR: "Visual Studio 16 2019" - CMAKE_SYSTEM_VERSION: "10.0.18363.657" - WINDOWS_DEPS_VERSION: '2019' - VIRTUALCAM-GUID: "A3FCE0F5-3493-419F-958A-ABA1250EC20B" - steps: - - name: 'Add msbuild to PATH' - uses: microsoft/setup-msbuild@v1.0.2 - - name: 'Checkout' - uses: actions/checkout@v2.3.3 - with: - submodules: 'recursive' - - name: 'Fetch Git Tags' + mkdir build + cd build + cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake .. + - name: 'Build OBS Studio libraries' + working-directory: ${{ github.workspace }}/obs-studio shell: bash run: | - git fetch --prune --unshallow - echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV - echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - - name: 'Check for Github Labels' - if: github.event_name == 'pull_request' + set -e + cd ./build + make -j4 libobs obs-frontend-api + - name: 'Configure obs-midi' + working-directory: ${{ github.workspace }}/obs-midi shell: bash run: | - LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')" - LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)" - if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then - echo "SEEKING_TESTERS=1" >> $GITHUB_ENV - else - echo "SEEKING_TESTERS=0" >> $GITHUB_ENV - fi - - name: 'Restore QT dependency from cache' - id: qt-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'qt-cache' - with: - path: ${{ github.workspace }}/cmbuild/QT - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.QT_VERSION }} - - name: 'Restore pre-built dependencies from cache' - id: deps-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'deps-cache' - with: - path: ${{ github.workspace }}/cmbuild/deps - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.WINDOWS_DEPS_VERSION }} - - name: 'Restore VLC dependency from cache' - id: vlc-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'vlc-cache' - with: - path: ${{ github.workspace }}/cmbuild/vlc - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.WINDOWS_VLC_VERSION }} - - name: 'Restore CEF dependency from cache (32 bit)' - id: cef-cache - uses: actions/cache@v2.1.2 - env: - CACHE_NAME: 'cef-32-cache' - with: - path: ${{ github.workspace }}/cmbuild/cef_binary_${{ env.CEF_VERSION }}_windows32_minimal - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_VERSION }} - - name: 'Install prerequisite: QT' - if: steps.qt-cache.outputs.cache-hit != 'true' + mkdir build + cd build + cmake -DQTDIR=/usr/local/Cellar/qt/${{ env.QT_VERSION }} -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-midi' + working-directory: ${{ github.workspace }}/obs-midi + shell: bash run: | - curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - - 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}/cmbuild/QT" - - name: 'Install prerequisite: Pre-built dependencies' - if: steps.deps-cache.outputs.cache-hit != 'true' + set -e + cd ./build + make -j4 + - name: 'Install prerequisite: Packages app' + if: success() + shell: bash 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: 'Install prerequisite: VLC' - if: steps.vlc-cache.outputs.cache-hit != 'true' + curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg + sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target / + - name: 'Set PR artifact filename' + shell: bash run: | - curl -kL https://cdn-fastly.obsproject.com/downloads/vlc.zip -f --retry 5 -o vlc.zip - 7z x vlc.zip -o"${{ github.workspace }}/cmbuild/vlc" - - name: 'Install prerequisite: Chromium Embedded Framework' - if: steps.cef-cache.outputs.cache-hit != 'true' + FILENAME_UNSIGNED="obs-midi-${{ env.GIT_HASH }}-macOS-Unsigned.pkg" + echo "::set-env name=FILENAME_UNSIGNED::$FILENAME_UNSIGNED" + - name: 'Fix linked dynamic library paths' + if: success() + working-directory: ${{ github.workspace }}/obs-midi + shell: bash run: | - curl -kL https://cdn-fastly.obsproject.com/downloads/cef_binary_${{ env.CEF_VERSION }}_windows32_minimal.zip -f --retry 5 -o cef.zip - 7z x cef.zip -o"${{ github.workspace }}/cmbuild" - - name: 'Configure' + install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./build/obs-midi.so + install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./build/obs-midi.so + install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-midi.so + echo "Dependencies for obs-midi" + otool -L ./build/obs-midi.so + - name: 'Package ${{ env.FILENAME }}' + if: success() + working-directory: ./obs-midi + shell: bash run: | - mkdir ./build - mkdir ./build32 - cd ./build32 - cmake -G"${{ env.CMAKE_GENERATOR }}" -A"Win32" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DENABLE_VLC=ON -DBUILD_BROWSER=true -DCOMPILE_D3D12_HOOK=true -DVLCPath="${{ github.workspace }}/cmbuild/vlc" -DDepsPath="${{ github.workspace }}/cmbuild/deps/win32" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019" -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/cef_binary_${{ env.CEF_VERSION }}_windows32_minimal" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE -DVIRTUALCAM_GUID=${{ env.VIRTUALCAM-GUID }} .. - - name: 'Build' - run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-studio.sln - - name: 'Package' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - run: | - $env:FILE_DATE=(Get-Date -UFormat "%F") - $env:FILE_NAME="${env:FILE_DATE}-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-win32.zip" - echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV} - robocopy .\build32\rundir\RelWithDebInfo .\build\ /E /XF .gitignore - 7z a ${env:FILE_NAME} .\build\* - - name: 'Publish' - if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') - uses: actions/upload-artifact@v2.2.0 + packagesbuild ./CI/macos/obs-midi.pkgproj + mv ./release/obs-midi.pkg ./release/${{ env.FILENAME_UNSIGNED }} + - name: 'Publish ${{ env.FILENAME_UNSIGNED }} artifact' + if: success() + uses: actions/upload-artifact@v2-preview with: - name: '${{ env.FILE_NAME }}' - path: '*-win32.zip' + name: '${{ env.GIT_HASH }}-macOS' + path: ${{ github.workspace }}/obs-midi/release/*.pkg From 1cd6bdebf871fa86fa105aaba4ae0c25010e3546 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:20:35 -0500 Subject: [PATCH 09/53] Update cmake.yml --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index eefc4521..ff8e3df3 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -19,6 +19,7 @@ jobs: WINDOWS_DEPS_VERSION: '2017' CMAKE_GENERATOR: "Visual Studio 16 2019" CMAKE_SYSTEM_VERSION: "10.0" + ACTIONS_ALLOW_UNSECURE_COMMANDS: true steps: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.0.0 From b7454aabf465add79a21b401b1b1c60f3f3cf9a1 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:22:46 -0500 Subject: [PATCH 10/53] Update cmake.yml --- .github/workflows/cmake.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ff8e3df3..56bcbe00 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -8,7 +8,8 @@ on: paths-ignore: - '**.md' - +env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true jobs: windows: name: 'Windows 32+64bit' From 63f21e1e38388aa175b431d6f3d03a74e39c17a0 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:28:05 -0500 Subject: [PATCH 11/53] Create Brewfile --- CI/macos/Brewfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 CI/macos/Brewfile diff --git a/CI/macos/Brewfile b/CI/macos/Brewfile new file mode 100644 index 00000000..65281546 --- /dev/null +++ b/CI/macos/Brewfile @@ -0,0 +1,10 @@ +tap "akeru-inc/tap" +brew "jack" +brew "speexdsp" +brew "cmake" +brew "freetype" +brew "fdk-aac" +brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb" +brew "swig", link: false +brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb" +brew "akeru-inc/tap/xcnotary" From 8963250cee5908cfdca8b49ec28f8e198c58f18f Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:30:17 -0500 Subject: [PATCH 12/53] Update cmake.yml --- .github/workflows/cmake.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 56bcbe00..60f8f528 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -224,6 +224,8 @@ jobs: libvlc-dev \ libx11-dev \ libx264-dev \ + libx11-xcb-dev \ + libx11-xcb1 \ libxcb-randr0-dev \ libxcb-shm0-dev \ libxcb-xinerama0-dev \ From 8708326f5e79c9dee4609bc1d3fe71ac32949467 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:33:36 -0500 Subject: [PATCH 13/53] Update Brewfile --- CI/macos/Brewfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/macos/Brewfile b/CI/macos/Brewfile index 65281546..5e90ca92 100644 --- a/CI/macos/Brewfile +++ b/CI/macos/Brewfile @@ -4,7 +4,7 @@ brew "speexdsp" brew "cmake" brew "freetype" brew "fdk-aac" -brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb" +brew "qt" brew "swig", link: false brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb" brew "akeru-inc/tap/xcnotary" From 35c2d4b16c925ef88a8c95a0dfd549eb73579f37 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:36:54 -0500 Subject: [PATCH 14/53] Update Brewfile --- CI/macos/Brewfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CI/macos/Brewfile b/CI/macos/Brewfile index 5e90ca92..cdffd8c7 100644 --- a/CI/macos/Brewfile +++ b/CI/macos/Brewfile @@ -5,6 +5,5 @@ brew "cmake" brew "freetype" brew "fdk-aac" brew "qt" -brew "swig", link: false -brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb" +brew "swig" brew "akeru-inc/tap/xcnotary" From 0117047c53d076c17e6c63193275f9c18ccf8ab5 Mon Sep 17 00:00:00 2001 From: Christopher P Yarger Date: Sun, 7 Feb 2021 14:49:29 -0500 Subject: [PATCH 15/53] new cmakelists.txt --- CMakeLists.txt | 282 ++++++++++++++++++++++--------------------------- 1 file changed, 129 insertions(+), 153 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09f95f42..989db83e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,26 @@ -cmake_minimum_required(VERSION 3.10) -# Change obs-plugintemplate to your plugin's name in a machine-readable format -# (e.g.: obs-myawesomeplugin) and set -project(obs-midi VERSION 0.2.4) +cmake_minimum_required(VERSION 3.5) +project(obs-midi VERSION 0.9.0) -# Replace `Your Name Here` with the name (yours or your organization's) you want -# to see as the author of the plugin (in the plugin's metadata itself and in the installers) -set(PLUGIN_AUTHOR "Alzy") +set(CMAKE_PREFIX_PATH "${QTDIR}") +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS releases -# (used both in the installer and when submitting the installer for notarization) -set(MACOS_BUNDLEID "com.example.obs-midi") +add_definitions(-DASIO_STANDALONE) -# Replace `me@contoso.com` with the maintainer email address you want to put in Linux packages -set(LINUX_MAINTAINER_EMAIL "alfredo@seriousbusiness.la") +if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") + set(CMAKE_CXX_FLAGS "-mfpu=neon") +endif() -if(WIN32) - set(MODULE_DESCRIPTION "OBS MIDI module") +if (WIN32 OR APPLE) + include(external/FindLibObs.cmake) endif() +find_package(LibObs REQUIRED) +find_package(Qt5 REQUIRED COMPONENTS Core Widgets) # Version bits execute_process( COMMAND git rev-parse --abbrev-ref HEAD @@ -110,139 +113,119 @@ list(APPEND obs-midi_HEADERS src/events.h src/rpc/RpcEvent.h ) - add_library(obs-midi MODULE - ${obs-midi_SOURCES} - ${obs-midi_HEADERS} - ${plugin_ui_headers}) + ${obs-midi_SOURCES} + ${obs-midi_HEADERS}) + +include_directories( + "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" + ${Qt5Core_INCLUDES} + ${Qt5Widgets_INCLUDES} + "${CMAKE_SOURCE_DIR}/deps/asio/asio/include") +target_link_libraries(obs-midi + libobs + Qt5::Core + Qt5::Widgets) +# --- Windows-specific build settings and tasks --- +if(WIN32) + if(NOT DEFINED OBS_FRONTEND_LIB) + set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library") + message(FATAL_ERROR "Could not find OBS Frontend API's library !") + endif() -if(WIN32 OR LINUX) - if (${isAzure}) + if(MSVC) + # Enable Multicore Builds and disable FH4 (to not depend on VCRUNTIME140_1.DLL) + add_definitions(/MP /d2FH4-) + endif() - target_link_libraries(obs-midi - "${OBS_FRONTEND_LIB}" - ${obs-midi_DEPS} - Qt5::Core - Qt5::Widgets - libobs) + add_definitions(-D_WEBSOCKETPP_CPP11_STL_) + + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(ARCH_NAME "64bit") + set(OBS_BUILDDIR_ARCH "build64") else() - target_link_libraries(obs-midi - obs-frontend-api - ${obs-midi_DEPS} - Qt5::Core - Qt5::Widgets - libobs) - endif() -else() - target_link_libraries(obs-midi - "${OBS_FRONTEND_LIB}" - ${obs-midi_DEPS} - Qt5::Core - Qt5::Widgets - libobs) -endif() -if (${isAzure}) -# --- Windows-specific build settings and tasks --- - - if(WIN32) - if(NOT DEFINED OBS_FRONTEND_LIB) - set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library") - message(FATAL_ERROR "Could not find OBS Frontend API's library !") - endif() - - if(MSVC) - # Enable Multicore Builds and disable FH4 (to not depend on VCRUNTIME140_1.DLL) - add_definitions(/MP /d2FH4-) - endif() - - - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(ARCH_NAME "64bit") - set(OBS_BUILDDIR_ARCH "build64") - else() - set(ARCH_NAME "32bit") - set(OBS_BUILDDIR_ARCH "build32") - endif() - - include_directories( - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/UI" - ) - - target_link_libraries(obs-midi - "${OBS_FRONTEND_LIB}") - - # --- Release package helper --- - # The "release" folder has a structure similar OBS' one on Windows - set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release") - add_custom_command(TARGET obs-midi POST_BUILD - # If config is Release, package release files - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E make_directory - "${RELEASE_DIR}/data/obs-plugins/obs-midi" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") - - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory - "${PROJECT_SOURCE_DIR}/data" - "${RELEASE_DIR}/data/obs-plugins/obs-midi") + set(ARCH_NAME "32bit") + set(OBS_BUILDDIR_ARCH "build32") + endif() - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy - "$" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") - - # In Release mode, copy Qt image format plugins - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy - "${QTDIR}/plugins/imageformats/qjpeg.dll" - "${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll") - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy - "${QTDIR}/plugins/imageformats/qjpeg.dll" - "${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll") - - # If config is RelWithDebInfo, package release files - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E make_directory - "${RELEASE_DIR}/data/obs-plugins/obs-midi" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") - - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory - "${PROJECT_SOURCE_DIR}/data" - "${RELEASE_DIR}/data/obs-plugins/obs-midi") + include_directories( + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/UI" + ) - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + target_link_libraries(obs-midi + "${OBS_FRONTEND_LIB}") + + # --- Release package helper --- + # The "release" folder has a structure similar OBS' one on Windows + set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release") + + add_custom_command(TARGET obs-midi POST_BUILD + # If config is Release, package release files + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E make_directory + "${RELEASE_DIR}/data/obs-plugins/obs-midi" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory + "${PROJECT_SOURCE_DIR}/data" + "${RELEASE_DIR}/data/obs-plugins/obs-midi") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "$" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + # In Release mode, copy Qt image format plugins + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy + "${QTDIR}/plugins/imageformats/qjpeg.dll" + "${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll") + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy + "${QTDIR}/plugins/imageformats/qjpeg.dll" + "${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll") + + # If config is RelWithDebInfo, package release files + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E make_directory + "${RELEASE_DIR}/data/obs-plugins/obs-midi" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory + "${PROJECT_SOURCE_DIR}/data" + "${RELEASE_DIR}/data/obs-plugins/obs-midi") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "$" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "$" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + # Copy to obs-studio dev environment for immediate testing + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy "$" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy "$" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") - - # Copy to obs-studio dev environment for immediate testing - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy - "$" - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") - - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy - "$" - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") - - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E make_directory - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-midi") - - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy_directory - "${PROJECT_SOURCE_DIR}/data" - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-midi") - ) - # --- End of sub-section --- + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E make_directory + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-midi") + + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy_directory + "${PROJECT_SOURCE_DIR}/data" + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-midi") + ) + # --- End of sub-section --- - endif() - # --- End of section --- endif() -# -- End of if AZURE +# --- End of section --- # --- Linux-specific build settings and tasks --- if(UNIX AND NOT APPLE) @@ -253,12 +236,17 @@ if(UNIX AND NOT APPLE) file(GLOB locale_files data/locale/*.ini) + set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + if(${USE_UBUNTU_FIX}) - install(TARGETS obs-midi - LIBRARY DESTINATION "/usr/lib/obs-plugins") + install(TARGETS obs-midi LIBRARY + DESTINATION "/usr/lib/obs-plugins" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) endif() - install(TARGETS obs-midi - LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") + install(TARGETS obs-midi LIBRARY + DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) install(FILES ${locale_files} DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/obs-midi/locale") @@ -268,21 +256,9 @@ endif() # -- OS X specific build settings and tasks -- if(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fvisibility=default") + set(CMAKE_SKIP_RPATH TRUE) set_target_properties(obs-midi PROPERTIES PREFIX "") target_link_libraries(obs-midi "${OBS_FRONTEND_LIB}") endif() # -- End of section -- - - - -# -- Fixes issue where plugin isn't copied to rundir plugins directory on local build -- -if(WIN32) - if (${isAzure}) - - install_obs_plugin_with_data(obs-midi data) - endif() -endif() - -set_target_properties(obs-midi PROPERTIES FOLDER "plugins/obs-midi") -set_target_properties(RtMidi17 PROPERTIES FOLDER "plugins/obs-midi") From e01417d89387ed7d342eadb0cd9e5f6943d172bc Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:54:16 -0500 Subject: [PATCH 16/53] Update Brewfile --- CI/macos/Brewfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CI/macos/Brewfile b/CI/macos/Brewfile index cdffd8c7..65281546 100644 --- a/CI/macos/Brewfile +++ b/CI/macos/Brewfile @@ -4,6 +4,7 @@ brew "speexdsp" brew "cmake" brew "freetype" brew "fdk-aac" -brew "qt" -brew "swig" +brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb" +brew "swig", link: false +brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb" brew "akeru-inc/tap/xcnotary" From 160549fbef90e4993d9ff52161ad42b3b8fd1859 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 14:56:29 -0500 Subject: [PATCH 17/53] Update install-dependencies-macos.sh --- CI/install-dependencies-macos.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CI/install-dependencies-macos.sh b/CI/install-dependencies-macos.sh index 835f312c..267fa49a 100755 --- a/CI/install-dependencies-macos.sh +++ b/CI/install-dependencies-macos.sh @@ -5,36 +5,36 @@ OSTYPE=$(uname) if [ "${OSTYPE}" != "Darwin" ]; then - echo "[obs-midi - Error] macOS install dependencies script can be run on Darwin-type OS only." + echo "[obs-websocket - Error] macOS install dependencies script can be run on Darwin-type OS only." exit 1 fi HAS_BREW=$(type brew 2>/dev/null) if [ "${HAS_BREW}" = "" ]; then - echo "[obs-midi - Error] Please install Homebrew (https://www.brew.sh/) to build obs-midi on macOS." + echo "[obs-websocket - Error] Please install Homebrew (https://www.brew.sh/) to build obs-websocket on macOS." exit 1 fi # OBS Studio deps -echo "[obs-midi] Updating Homebrew.." +echo "[obs-websocket] Updating Homebrew.." brew update >/dev/null -echo "[obs-midi] Checking installed Homebrew formulas.." +echo "[obs-websocket] Checking installed Homebrew formulas.." BREW_PACKAGES=$(brew list) -BREW_DEPENDENCIES="speexdsp ccache swig mbedtls" +BREW_DEPENDENCIES="jack speexdsp ccache swig mbedtls" for DEPENDENCY in ${BREW_DEPENDENCIES}; do if echo "${BREW_PACKAGES}" | grep -q "^${DEPENDENCY}\$"; then - echo "[obs-midi] Upgrading OBS-Studio dependency '${DEPENDENCY}'.." + echo "[obs-websocket] Upgrading OBS-Studio dependency '${DEPENDENCY}'.." brew upgrade ${DEPENDENCY} 2>/dev/null else - echo "[obs-midi] Installing OBS-Studio dependency '${DEPENDENCY}'.." + echo "[obs-websocket] Installing OBS-Studio dependency '${DEPENDENCY}'.." brew install ${DEPENDENCY} 2>/dev/null fi done -# qtmidis deps -echo "[obs-midi] Installing obs-midi dependency 'QT 5.10.1'.." +# qtwebsockets deps +echo "[obs-websocket] Installing obs-websocket dependency 'QT 5.10.1'.." brew install ./CI/macos/qt.rb @@ -50,7 +50,7 @@ brew pin qt HAS_PACKAGES=$(type packagesbuild 2>/dev/null) if [ "${HAS_PACKAGES}" = "" ]; then - echo "[obs-midi] Installing Packaging app (might require password due to 'sudo').." + echo "[obs-websocket] 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 / fi From 71c201ca96041bac29f27455109a8be9b535452a Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 15:00:44 -0500 Subject: [PATCH 18/53] Update Brewfile --- CI/macos/Brewfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CI/macos/Brewfile b/CI/macos/Brewfile index 65281546..f3aa898c 100644 --- a/CI/macos/Brewfile +++ b/CI/macos/Brewfile @@ -4,7 +4,7 @@ brew "speexdsp" brew "cmake" brew "freetype" brew "fdk-aac" -brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb" +brew "./qt.rb" brew "swig", link: false -brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb" +brew "./swig.rb" brew "akeru-inc/tap/xcnotary" From 84f9d9ba34f987ba1227341056a926c5205841a3 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 15:01:16 -0500 Subject: [PATCH 19/53] Create swig.rb --- CI/macos/swig.rb | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 CI/macos/swig.rb diff --git a/CI/macos/swig.rb b/CI/macos/swig.rb new file mode 100644 index 00000000..9b27d69b --- /dev/null +++ b/CI/macos/swig.rb @@ -0,0 +1,56 @@ + +class Swig < Formula + desc "Generate scripting interfaces to C/C++ code" + homepage "http://www.swig.org/" + url "https://downloads.sourceforge.net/project/swig/swig/swig-3.0.12/swig-3.0.12.tar.gz" + sha256 "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d" + + bottle do + sha256 "7307b4ffe3222715b2206e6477c5e3022881a730eb95a717d41a3df8e6e20455" => :mojave + sha256 "c0e2656fd10d57281280d20ce8bf9a060cf8714f4283dd1dfde383b3688d9ed1" => :high_sierra + sha256 "68cb1b6bc898f2a1bd39ae24dd0235f68ffa56d04ba8cd4424835335202977d1" => :sierra + sha256 "37bf242aad0c18317cdaef66218483c04fa57e091b7c7f9d72089f5002881338" => :el_capitan + sha256 "3443dbf17f78be0cecb5419772c71bb418caa91763590072224c196a57317717" => :yosemite + end + + head do + url "https://github.com/swig/swig.git" + + depends_on "autoconf" => :build + depends_on "automake" => :build + end + + depends_on "pcre" + + def install + system "./autogen.sh" if build.head? + system "./configure", "--disable-dependency-tracking", + "--prefix=#{prefix}" + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~EOS + int add(int x, int y) + { + return x + y; + } + EOS + (testpath/"test.i").write <<~EOS + %module test + %inline %{ + extern int add(int x, int y); + %} + EOS + (testpath/"run.rb").write <<~EOS + require "./test" + puts Test.add(1, 1) + EOS + system "#{bin}/swig", "-ruby", "test.i" + system ENV.cc, "-c", "test.c" + system ENV.cc, "-c", "test_wrap.c", "-I#{MacOS.sdk_path}/System/Library/Frameworks/Ruby.framework/Headers/" + system ENV.cc, "-bundle", "-undefined", "dynamic_lookup", "test.o", "test_wrap.o", "-o", "test.bundle" + assert_equal "2", shell_output("/usr/bin/ruby run.rb").strip + end +end From 724a04085fc1c68009a98286fe4d7fb8fb541fce Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 15:09:17 -0500 Subject: [PATCH 20/53] Update install-dependencies-macos.sh --- CI/install-dependencies-macos.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CI/install-dependencies-macos.sh b/CI/install-dependencies-macos.sh index 267fa49a..8b7025ed 100755 --- a/CI/install-dependencies-macos.sh +++ b/CI/install-dependencies-macos.sh @@ -35,8 +35,16 @@ done # qtwebsockets deps echo "[obs-websocket] Installing obs-websocket dependency 'QT 5.10.1'.." - +tap akeru-inc/tap +brew install jack +brew install speexdsp +brew install cmake +brew install freetype +brew install fdk-aac brew install ./CI/macos/qt.rb +brew install ./CI/macos/swig.rb +brew install akeru-inc/tap/xcnotary + # Pin this version of QT5 to avoid `brew upgrade` # upgrading it to incompatible version From 8b4a8e67e5182b88183131a3ac67dc59423874c1 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 15:10:27 -0500 Subject: [PATCH 21/53] Update cmake.yml --- .github/workflows/cmake.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 60f8f528..40be8ef3 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -340,10 +340,7 @@ jobs: echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) - - name: 'Install prerequisites (Homebrew)' - shell: bash - run: | - brew bundle --file ${{ github.workspace }}/obs-midi/CI/macos/Brewfile + - name: 'Install prerequisite: Pre-built OBS dependencies' shell: bash run: | From 787d7c92d9c5e430d1fe0e031c3d041eca64a18c Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 15:18:45 -0500 Subject: [PATCH 22/53] Update cmake.yml --- .github/workflows/cmake.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 40be8ef3..83d83ba5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -340,7 +340,11 @@ jobs: echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) - + - name: 'Install Deps' + shell: bash + working-directory: ${{ github.workspace }}/obs-midi + run: | + ./CI/install-dependencies-macos.sh - name: 'Install prerequisite: Pre-built OBS dependencies' shell: bash run: | From e78f5f11e436eaf67cb3caee82654ab192db598e Mon Sep 17 00:00:00 2001 From: Christopher P Yarger Date: Sun, 7 Feb 2021 15:30:29 -0500 Subject: [PATCH 23/53] change cmake --- CMakeLists.txt | 44 +++++++------------------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 989db83e..12942d8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,35 +53,6 @@ set(obs-midi_DEPS RtMidi17) include_directories(src/RtMidi17) -set(plugin_ui - src/forms/settings-dialog.ui -) -if (NOT ${isAzure}) -qt5_wrap_ui(plugin_ui_headers ${plugin_ui}) -endif() -# OBS MIDI -set(CMAKE_PREFIX_PATH "${QTDIR}") -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -add_definitions(-DASIO_STANDALONE) -if (${isAzure}) - if (WIN32 OR APPLE) - include(external/FindLibObs.cmake) - endif() - find_package(LibObs REQUIRED) -endif() -if (APPLE) - include(external/FindLibObs.cmake) - find_package(LibObs REQUIRED) -endif() - -find_package(Qt5 REQUIRED COMPONENTS Core Widgets) - include_directories( "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" SYSTEM @@ -90,7 +61,7 @@ include_directories( "${CMAKE_SOURCE_DIR}/UI") set(obs-midi_SOURCES - src/utils.cpp + src/utils.cpp src/config.cpp src/midi-agent.cpp src/device-manager.cpp @@ -98,9 +69,7 @@ set(obs-midi_SOURCES src/forms/settings-dialog.cpp src/obs-midi.cpp src/events.cpp - src/rpc/RpcEvent.cpp - -) + src/rpc/RpcEvent.cpp) list(APPEND obs-midi_HEADERS src/utils.h @@ -111,8 +80,7 @@ list(APPEND obs-midi_HEADERS src/forms/settings-dialog.h src/obs-midi.h src/events.h - src/rpc/RpcEvent.h -) + src/rpc/RpcEvent.h) add_library(obs-midi MODULE ${obs-midi_SOURCES} ${obs-midi_HEADERS}) @@ -123,9 +91,11 @@ include_directories( ${Qt5Widgets_INCLUDES} "${CMAKE_SOURCE_DIR}/deps/asio/asio/include") target_link_libraries(obs-midi - libobs + "${OBS_FRONTEND_LIB}" + ${obs-midi_DEPS} Qt5::Core - Qt5::Widgets) + Qt5::Widgets + libobs) # --- Windows-specific build settings and tasks --- if(WIN32) if(NOT DEFINED OBS_FRONTEND_LIB) From ccc337cee0dbff70ebef74d2ae0a89bd338f990f Mon Sep 17 00:00:00 2001 From: Christopher P Yarger Date: Sun, 7 Feb 2021 16:19:46 -0500 Subject: [PATCH 24/53] update qt.rb --- CI/macos/qt.rb | 75 +++++++++++--------------------------------------- 1 file changed, 16 insertions(+), 59 deletions(-) diff --git a/CI/macos/qt.rb b/CI/macos/qt.rb index 4405a240..e1362e15 100755 --- a/CI/macos/qt.rb +++ b/CI/macos/qt.rb @@ -3,45 +3,25 @@ class Qt < Formula desc "Cross-platform application and UI framework" homepage "https://www.qt.io/" - url "https://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" - mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" - sha256 "05ffba7b811b854ed558abf2be2ddbd3bb6ddd0b60ea4b5da75d277ac15e740a" - head "https://code.qt.io/qt/qt5.git", :branch => "5.10", :shallow => false + url "https://download.qt.io/official_releases/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" + mirror "https://mirrors.dotsrc.org/qtproject/archive/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" + mirror "https://mirrors.ocf.berkeley.edu/qt/archive/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" + sha256 "6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8" + + head "https://code.qt.io/qt/qt5.git", :branch => "dev", :shallow => false bottle do - sha256 "8b4bad005596a5f8790150fe455db998ac2406f4e0f04140d6656205d844d266" => :high_sierra - sha256 "9c488554935fb573554a4e36d36d3c81e47245b7fefc4b61edef894e67ba1740" => :sierra - sha256 "c0407afba5951df6cc4c6f6c1c315972bd41c99cecb4e029919c4c15ab6f7bdc" => :el_capitan + cellar :any + sha256 "e40589965586f2c1132da117aca2e0cf12f3ea4bb1029d26b4b0819d8aae3bd5" => :catalina + sha256 "149a1c2d2af7afda9910e1d4e3956c27ffa31ea511a8320930abf7a9079d0330" => :mojave + sha256 "69a7f1ad615f78735b6635da1b1fab5e4eea57dd9be560c695f82b796457870a" => :high_sierra end keg_only "Qt 5 has CMake issues when linked" - option "with-docs", "Build documentation" - option "with-examples", "Build examples" - option "without-proprietary-codecs", "Don't build with proprietary codecs (e.g. mp3)" - - # OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference - # configuration and thus untested in practice. Builds on OS X 10.7 have been - # reported to fail: . - # depends_on :macos => :mountain_lion - depends_on "pkg-config" => :build depends_on :xcode => :build - depends_on "mysql" => :optional - depends_on "postgresql" => :optional - - # Restore `.pc` files for framework-based build of Qt 5 on OS X. This - # partially reverts merged - # between the 5.5.1 and 5.6.0 releases. (Remove this as soon as feasible!) - # - # Core formulae known to fail without this patch (as of 2016-10-15): - # * gnuplot (with `--with-qt` option) - # * mkvtoolnix (with `--with-qt` option, silent build failure) - # * poppler (with `--with-qt` option) - patch do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/e8fe6567/qt5/restore-pc-files.patch" - sha256 "48ff18be2f4050de7288bddbae7f47e949512ac4bcd126c2f504be2ac701158b" - end + depends_on :macos => :sierra def install args = %W[ @@ -54,41 +34,19 @@ def install -qt-libjpeg -qt-freetype -qt-pcre + -nomake examples -nomake tests -no-rpath -pkg-config -dbus-runtime + -proprietary-codecs ] - args << "-nomake" << "examples" if build.without? "examples" - - if build.with? "mysql" - args << "-plugin-sql-mysql" - (buildpath/"brew_shim/mysql_config").write <<~EOS - #!/bin/sh - if [ x"$1" = x"--libs" ]; then - mysql_config --libs | sed "s/-lssl -lcrypto//" - else - exec mysql_config "$@" - fi - EOS - chmod 0755, "brew_shim/mysql_config" - args << "-mysql_config" << buildpath/"brew_shim/mysql_config" - end - - args << "-plugin-sql-psql" if build.with? "postgresql" - args << "-proprietary-codecs" if build.with? "proprietary-codecs" - system "./configure", *args system "make" ENV.deparallelize system "make", "install" - if build.with? "docs" - system "make", "docs" - system "make", "install_docs" - end - # Some config scripts will only find Qt in a "Frameworks" folder frameworks.install_symlink Dir["#{lib}/*.framework"] @@ -108,9 +66,9 @@ def install end def caveats; <<~EOS - We agreed to the Qt opensource license for you. + We agreed to the Qt open source license for you. If this is unacceptable you should uninstall. - EOS + EOS end test do @@ -127,7 +85,6 @@ def caveats; <<~EOS (testpath/"main.cpp").write <<~EOS #include #include - int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); @@ -142,4 +99,4 @@ def caveats; <<~EOS assert_predicate testpath/"main.o", :exist? system "./hello" end -end \ No newline at end of file +end From 268446083d7ce1ca749a240673ffd53232f25d3c Mon Sep 17 00:00:00 2001 From: Christopher P Yarger Date: Sun, 7 Feb 2021 16:21:27 -0500 Subject: [PATCH 25/53] update cmake.yml with exports --- .github/workflows/cmake.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 83d83ba5..09d6ad57 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -345,6 +345,10 @@ jobs: working-directory: ${{ github.workspace }}/obs-midi run: | ./CI/install-dependencies-macos.sh + echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> /Users/runner/.bash_profile + export LDFLAGS="-L/usr/local/opt/qt/lib" + export CPPFLAGS="-I/usr/local/opt/qt/include" + export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig" - name: 'Install prerequisite: Pre-built OBS dependencies' shell: bash run: | From 581d93d1ac9fee9386dea56af67489747556252d Mon Sep 17 00:00:00 2001 From: Christopher P Yarger Date: Sun, 7 Feb 2021 16:23:44 -0500 Subject: [PATCH 26/53] update cmake.yml with exports --- .github/workflows/cmake.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 09d6ad57..3dd96b77 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -346,9 +346,10 @@ jobs: run: | ./CI/install-dependencies-macos.sh echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> /Users/runner/.bash_profile - export LDFLAGS="-L/usr/local/opt/qt/lib" - export CPPFLAGS="-I/usr/local/opt/qt/include" - export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig" + echo ::set-env name=LDFLAGS="-L/usr/local/opt/qt/lib" + echo ::set-env name=CPPFLAGS="-I/usr/local/opt/qt/include" + echo ::set-env name=PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig" + echo ::set-env name=PATH="/usr/local/opt/qt/bin:$PATH" - name: 'Install prerequisite: Pre-built OBS dependencies' shell: bash run: | From 35f5966476a799e818379e6100e0653f1f4cb2b3 Mon Sep 17 00:00:00 2001 From: Christopher P Yarger Date: Sun, 7 Feb 2021 16:35:57 -0500 Subject: [PATCH 27/53] update cmake.yml with Publish --- .github/workflows/cmake.yml | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3dd96b77..f2e7250e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -417,3 +417,62 @@ jobs: with: name: '${{ env.GIT_HASH }}-macOS' path: ${{ github.workspace }}/obs-midi/release/*.pkg + + make-release: + name: 'Create and upload release' + runs-on: [ubuntu-latest] + needs: [windows, ubuntu64, macos64] + steps: + - name: 'Get the version' + shell: bash + id: get_version + run: | + echo ::set-env name=TAG_VERSION::${GITHUB_REF/refs\/tags\//} + - name: 'Create Release' + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.TAG_VERSION }} + release_name: obs-midi ${{ env.TAG_VERSION }} + draft: false + prerelease: false + - name: 'Download release artifacts' + uses: actions/download-artifact@v2-preview + - name: 'Upload Windows .zip artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-Windows/obs-midi-${{ env.TAG_VERSION }}-Windows.zip + asset_name: obs-midi-${{ env.TAG_VERSION }}-Windows.zip + asset_content_type: application/zip + - name: 'Upload Windows .exe artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-Windows-Installer/obs-midi-${{ env.TAG_VERSION }}-Windows-Installer.exe + asset_name: obs-midi-${{ env.TAG_VERSION }}-Windows-Installer.exe + asset_content_type: application/zip + - name: 'Upload Linux artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-linux/obs-midi_${{ env.TAG_VERSION }}-1_amd64.deb + asset_name: obs-midi-${{ env.TAG_VERSION }}-1_amd64.deb + asset_content_type: application/octet-stream + - name: 'Upload macOS artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-macOS/obs-midi-${{ env.TAG_VERSION }}-macOS.pkg + asset_name: obs-midi-${{ env.TAG_VERSION }}-macOS.pkg + asset_content_type: application/octet-stream From e1eee935f5b410d18c66b73226128042d695e4ab Mon Sep 17 00:00:00 2001 From: Christopher P Yarger Date: Sun, 7 Feb 2021 16:51:04 -0500 Subject: [PATCH 28/53] update cmake.yml for publishing --- .github/workflows/cmake.yml | 62 +++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f2e7250e..b4375d14 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -129,11 +129,11 @@ jobs: - name: 'Build obs-midi 32-bit' working-directory: ${{ github.workspace }}/obs-midi run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-midi.sln - - name: 'Set PR artifact filename' + - name: 'Set release filename' shell: bash run: | - FILENAME="obs-midi-${{ env.GIT_HASH }}-Windows" - echo "::set-env name=FILENAME::$FILENAME" + FILENAME="obs-midi-${{ env.GIT_TAG }}-Windows" + echo "::set-env name=WIN_FILENAME::$FILENAME" - name: 'Package obs-midi' working-directory: ${{ github.workspace }}/obs-midi run: | @@ -145,13 +145,13 @@ jobs: if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_HASH }}-Windows' + name: '${{ env.GIT_TAG }}-Windows' path: ${{ github.workspace }}/obs-midi/package/*.zip - name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe' if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_HASH }}-Windows-Installer' + name: '${{ env.GIT_TAG }}-Windows-Installer' path: ${{ github.workspace }}/obs-midi/package/*.exe ubuntu64: name: "Linux/Ubuntu 64-bit" @@ -274,17 +274,17 @@ jobs: set -e cd ./build make -j4 - - name: 'Set PR artifact filename' + - name: 'Set release filename' shell: bash run: | - FILENAME="obs-midi-1-${{ env.GIT_HASH }}-1_amd64.deb" - echo "::set-env name=FILENAME::$FILENAME" - - name: 'Package ${{ env.FILENAME }}' + FILENAME="obs-midi-${{ env.GIT_TAG }}-1_amd64.deb" + echo "::set-env name=LINUX_FILENAME::$FILENAME" + - name: 'Package ${{ env.LINUX_FILENAME }}' if: success() working-directory: ${{ github.workspace }}/obs-midi shell: bash run: | - VERSION="1-${{ env.GIT_HASH }}-git" + VERSION="${{ env.GIT_TAG }}" cd ./build sudo checkinstall -y --type=debian --fstrans=no -nodoc \ --backup=no --deldoc=yes --install=no --pkgname=obs-midi --pkgversion=$VERSION \ @@ -294,11 +294,11 @@ jobs: --pakdir="../package" sudo chmod ao+r ../package/* cd - - - name: 'Publish ${{ env.FILENAME }}' + - name: 'Publish ${{ env.LINUX_FILENAME }}' if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_HASH }}-linux' + name: '${{ env.GIT_TAG }}-linux' path: '${{ github.workspace }}/obs-midi/package/*.deb' macos64: name: "macOS 64-bit" @@ -389,11 +389,14 @@ jobs: run: | curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target / - - name: 'Set PR artifact filename' + - name: 'Set release filename' + if: success() && startsWith(github.ref, 'refs/tags') shell: bash run: | - FILENAME_UNSIGNED="obs-midi-${{ env.GIT_HASH }}-macOS-Unsigned.pkg" - echo "::set-env name=FILENAME_UNSIGNED::$FILENAME_UNSIGNED" + FILENAME_UNSIGNED="obs-midi-${{ env.GIT_TAG }}-macOS-Unsigned.pkg" + FILENAME="obs-midi-${{ env.GIT_TAG }}-macOS.pkg" + echo "::set-env name=MAC_FILENAME_UNSIGNED::$FILENAME_UNSIGNED" + echo "::set-env name=MAC_FILENAME::$FILENAME" - name: 'Fix linked dynamic library paths' if: success() working-directory: ${{ github.workspace }}/obs-midi @@ -404,18 +407,37 @@ jobs: install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-midi.so echo "Dependencies for obs-midi" otool -L ./build/obs-midi.so - - name: 'Package ${{ env.FILENAME }}' + - name: 'Install Apple Developer Certificate' + if: success() + uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071 + with: + p12-file-base64: ${{ secrets.MACOS_CERT_CODESIGN }} + p12-password: ${{ secrets.MACOS_CERT_PASS }} + - name: 'Code signing' if: success() working-directory: ./obs-midi shell: bash run: | + set -e + codesign --sign "${{ secrets.MACOS_IDENT_CODESIGN }}" ./build/obs-midi.so packagesbuild ./CI/macos/obs-midi.pkgproj - mv ./release/obs-midi.pkg ./release/${{ env.FILENAME_UNSIGNED }} - - name: 'Publish ${{ env.FILENAME_UNSIGNED }} artifact' + mv ./release/obs-midi.pkg ./release/${{ env.MAC_FILENAME_UNSIGNED }} + productsign --sign "${{ secrets.MACOS_IDENT_INSTALLER }}" ./release/${{ env.MAC_FILENAME_UNSIGNED }} ./release/${{ env.MAC_FILENAME }} + rm ./release/${{ env.MAC_FILENAME_UNSIGNED }} + - name: 'Notarization' if: success() + working-directory: ./obs-midi + shell: bash + run: | + set -e + xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.MACOS_IDENT_USER }}" -p "${{ secrets.MACOS_IDENT_PASS }}" + xcnotary precheck ./release/${{ env.MAC_FILENAME }} + if [ "$?" -eq 0 ]; then xcnotary notarize ./release/${{ env.MAC_FILENAME }} --developer-account "${{ secrets.MACOS_IDENT_USER }}" --developer-password-keychain-item "AC_PASSWORD" --provider "${{ secrets.MACOS_IDENT_PROVIDER }}"; fi + - name: 'Publish ${{ env.MAC_FILENAME }} artifact' + if: success() && startsWith(github.ref, 'refs/tags') uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_HASH }}-macOS' + name: '${{ env.GIT_TAG }}-macOS' path: ${{ github.workspace }}/obs-midi/release/*.pkg make-release: @@ -472,7 +494,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} + upload_url: ${{ steps.crea te_release.outputs.upload_url }} asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-macOS/obs-midi-${{ env.TAG_VERSION }}-macOS.pkg asset_name: obs-midi-${{ env.TAG_VERSION }}-macOS.pkg asset_content_type: application/octet-stream From 8e53156949078d61813ddffc23f1fd95aaeca5fc Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 16:53:26 -0500 Subject: [PATCH 29/53] Update cmake.yml --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b4375d14..fe540a96 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -129,7 +129,7 @@ jobs: - name: 'Build obs-midi 32-bit' working-directory: ${{ github.workspace }}/obs-midi run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-midi.sln - - name: 'Set release filename' + - name: 'Set release filename' shell: bash run: | FILENAME="obs-midi-${{ env.GIT_TAG }}-Windows" @@ -389,7 +389,7 @@ jobs: run: | curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target / - - name: 'Set release filename' + - name: 'Set release filename' if: success() && startsWith(github.ref, 'refs/tags') shell: bash run: | From 54d96cea37f167ce501f16c313804545fb300b71 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 16:57:24 -0500 Subject: [PATCH 30/53] Update cmake.yml --- .github/workflows/cmake.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index fe540a96..3c35916d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -407,32 +407,6 @@ jobs: install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-midi.so echo "Dependencies for obs-midi" otool -L ./build/obs-midi.so - - name: 'Install Apple Developer Certificate' - if: success() - uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071 - with: - p12-file-base64: ${{ secrets.MACOS_CERT_CODESIGN }} - p12-password: ${{ secrets.MACOS_CERT_PASS }} - - name: 'Code signing' - if: success() - working-directory: ./obs-midi - shell: bash - run: | - set -e - codesign --sign "${{ secrets.MACOS_IDENT_CODESIGN }}" ./build/obs-midi.so - packagesbuild ./CI/macos/obs-midi.pkgproj - mv ./release/obs-midi.pkg ./release/${{ env.MAC_FILENAME_UNSIGNED }} - productsign --sign "${{ secrets.MACOS_IDENT_INSTALLER }}" ./release/${{ env.MAC_FILENAME_UNSIGNED }} ./release/${{ env.MAC_FILENAME }} - rm ./release/${{ env.MAC_FILENAME_UNSIGNED }} - - name: 'Notarization' - if: success() - working-directory: ./obs-midi - shell: bash - run: | - set -e - xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.MACOS_IDENT_USER }}" -p "${{ secrets.MACOS_IDENT_PASS }}" - xcnotary precheck ./release/${{ env.MAC_FILENAME }} - if [ "$?" -eq 0 ]; then xcnotary notarize ./release/${{ env.MAC_FILENAME }} --developer-account "${{ secrets.MACOS_IDENT_USER }}" --developer-password-keychain-item "AC_PASSWORD" --provider "${{ secrets.MACOS_IDENT_PROVIDER }}"; fi - name: 'Publish ${{ env.MAC_FILENAME }} artifact' if: success() && startsWith(github.ref, 'refs/tags') uses: actions/upload-artifact@v2-preview From 1434651747b9458e7afb1a0531b611672fe3c401 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 17:01:21 -0500 Subject: [PATCH 31/53] Update cmake.yml --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3c35916d..4e8ff548 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -390,7 +390,7 @@ jobs: curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target / - name: 'Set release filename' - if: success() && startsWith(github.ref, 'refs/tags') + if: success() shell: bash run: | FILENAME_UNSIGNED="obs-midi-${{ env.GIT_TAG }}-macOS-Unsigned.pkg" @@ -408,7 +408,7 @@ jobs: echo "Dependencies for obs-midi" otool -L ./build/obs-midi.so - name: 'Publish ${{ env.MAC_FILENAME }} artifact' - if: success() && startsWith(github.ref, 'refs/tags') + if: success() uses: actions/upload-artifact@v2-preview with: name: '${{ env.GIT_TAG }}-macOS' From 49b9bd60d7e2d6c607272598a1cba2542f075cef Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 17:13:40 -0500 Subject: [PATCH 32/53] Update cmake.yml --- .github/workflows/cmake.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4e8ff548..b52a17b0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -431,7 +431,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ env.TAG_VERSION }} - release_name: obs-midi ${{ env.TAG_VERSION }} + release_name: obs-midi ${{ env.GIT_TAG }} draft: false prerelease: false - name: 'Download release artifacts' @@ -442,8 +442,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-Windows/obs-midi-${{ env.TAG_VERSION }}-Windows.zip - asset_name: obs-midi-${{ env.TAG_VERSION }}-Windows.zip + asset_path: ${{ github.workspace }}obs-midi/release/*.zip + asset_name: obs-midi-${{env.GIT_TAG }}-Windows.zip asset_content_type: application/zip - name: 'Upload Windows .exe artifact to release' uses: actions/upload-release-asset@v1 @@ -451,8 +451,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-Windows-Installer/obs-midi-${{ env.TAG_VERSION }}-Windows-Installer.exe - asset_name: obs-midi-${{ env.TAG_VERSION }}-Windows-Installer.exe + asset_path: ${{ github.workspace }}obs-midi/release/obs-midi-${{env.GIT_TAG }}-Windows-Installer.exe + asset_name: obs-midi-${{ env.GIT_TAG }}-Windows-Installer.exe asset_content_type: application/zip - name: 'Upload Linux artifact to release' uses: actions/upload-release-asset@v1 @@ -460,15 +460,16 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-linux/obs-midi_${{ env.TAG_VERSION }}-1_amd64.deb - asset_name: obs-midi-${{ env.TAG_VERSION }}-1_amd64.deb + asset_path: ${{ github.workspace }}obs-midi/release/obs-midi_${{ env.GIT_TAG }}-1_amd64.deb + asset_name: obs-midi-${{ env.GIT_TAG }}-1_amd64.deb asset_content_type: application/octet-stream - name: 'Upload macOS artifact to release' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.crea te_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-macOS/obs-midi-${{ env.TAG_VERSION }}-macOS.pkg - asset_name: obs-midi-${{ env.TAG_VERSION }}-macOS.pkg + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}obs-midi/release/obs-midi-${{ env.GIT_TAG }}-macOS.pkg + asset_name: obs-midi-${{ env.GIT_TAG }}-macOS.pkg asset_content_type: application/octet-stream + From 33530d7828d83a7065b0b37a388c0bd47000e937 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 17:21:56 -0500 Subject: [PATCH 33/53] Update cmake.yml change from git tag to git hash --- .github/workflows/cmake.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b52a17b0..eebf6bc1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -132,7 +132,7 @@ jobs: - name: 'Set release filename' shell: bash run: | - FILENAME="obs-midi-${{ env.GIT_TAG }}-Windows" + FILENAME="obs-midi-${{ env.GIT_HASH }}-Windows" echo "::set-env name=WIN_FILENAME::$FILENAME" - name: 'Package obs-midi' working-directory: ${{ github.workspace }}/obs-midi @@ -145,13 +145,13 @@ jobs: if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_TAG }}-Windows' + name: '${{ env.GIT_HASH }}-Windows' path: ${{ github.workspace }}/obs-midi/package/*.zip - name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe' if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_TAG }}-Windows-Installer' + name: '${{ env.GIT_HASH }}-Windows-Installer' path: ${{ github.workspace }}/obs-midi/package/*.exe ubuntu64: name: "Linux/Ubuntu 64-bit" @@ -277,7 +277,7 @@ jobs: - name: 'Set release filename' shell: bash run: | - FILENAME="obs-midi-${{ env.GIT_TAG }}-1_amd64.deb" + FILENAME="obs-midi-${{ env.GIT_HASH }}-1_amd64.deb" echo "::set-env name=LINUX_FILENAME::$FILENAME" - name: 'Package ${{ env.LINUX_FILENAME }}' if: success() @@ -298,7 +298,7 @@ jobs: if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_TAG }}-linux' + name: '${{ env.GIT_HASH }}-linux' path: '${{ github.workspace }}/obs-midi/package/*.deb' macos64: name: "macOS 64-bit" @@ -393,8 +393,8 @@ jobs: if: success() shell: bash run: | - FILENAME_UNSIGNED="obs-midi-${{ env.GIT_TAG }}-macOS-Unsigned.pkg" - FILENAME="obs-midi-${{ env.GIT_TAG }}-macOS.pkg" + FILENAME_UNSIGNED="obs-midi-${{ env.GIT_HASH }}-macOS-Unsigned.pkg" + FILENAME="obs-midi-${{ env.GIT_HASH }}-macOS.pkg" echo "::set-env name=MAC_FILENAME_UNSIGNED::$FILENAME_UNSIGNED" echo "::set-env name=MAC_FILENAME::$FILENAME" - name: 'Fix linked dynamic library paths' @@ -411,7 +411,7 @@ jobs: if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_TAG }}-macOS' + name: '${{ env.GIT_HASH }}-macOS' path: ${{ github.workspace }}/obs-midi/release/*.pkg make-release: @@ -431,7 +431,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ env.TAG_VERSION }} - release_name: obs-midi ${{ env.GIT_TAG }} + release_name: obs-midi ${{ env.GIT_HASH }} draft: false prerelease: false - name: 'Download release artifacts' @@ -443,7 +443,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ${{ github.workspace }}obs-midi/release/*.zip - asset_name: obs-midi-${{env.GIT_TAG }}-Windows.zip + asset_name: obs-midi-${{ env.GIT_HASH }}-Windows.zip asset_content_type: application/zip - name: 'Upload Windows .exe artifact to release' uses: actions/upload-release-asset@v1 @@ -451,8 +451,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}obs-midi/release/obs-midi-${{env.GIT_TAG }}-Windows-Installer.exe - asset_name: obs-midi-${{ env.GIT_TAG }}-Windows-Installer.exe + asset_path: ${{ github.workspace }}obs-midi/release/obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe + asset_name: obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_content_type: application/zip - name: 'Upload Linux artifact to release' uses: actions/upload-release-asset@v1 @@ -460,8 +460,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}obs-midi/release/obs-midi_${{ env.GIT_TAG }}-1_amd64.deb - asset_name: obs-midi-${{ env.GIT_TAG }}-1_amd64.deb + asset_path: ${{ github.workspace }}obs-midi/release/obs-midi_${{ env.GIT_HASH }}-1_amd64.deb + asset_name: obs-midi-${{ env.GIT_HASH }}-1_amd64.deb asset_content_type: application/octet-stream - name: 'Upload macOS artifact to release' uses: actions/upload-release-asset@v1 @@ -469,7 +469,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}obs-midi/release/obs-midi-${{ env.GIT_TAG }}-macOS.pkg - asset_name: obs-midi-${{ env.GIT_TAG }}-macOS.pkg + asset_path: ${{ github.workspace }}obs-midi/release/obs-midi-${{ env.GIT_HASH }}-macOS.pkg + asset_name: obs-midi-${{ env.GIT_HASH }}-macOS.pkg asset_content_type: application/octet-stream From c432dd1ddc711217414a7a5de8b7adf0a157f6ab Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 17:37:12 -0500 Subject: [PATCH 34/53] Update cmake.yml --- .github/workflows/cmake.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index eebf6bc1..2a551161 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -430,10 +430,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ env.TAG_VERSION }} - release_name: obs-midi ${{ env.GIT_HASH }} - draft: false - prerelease: false + release_name: obs-midi ALPHA 2 ${{ env.GIT_HASH }} + draft: true + prerelease: true - name: 'Download release artifacts' uses: actions/download-artifact@v2-preview - name: 'Upload Windows .zip artifact to release' From fa60fbc6fc928bf5802fa28115ae45f2ba96d8d7 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 17:49:25 -0500 Subject: [PATCH 35/53] Update cmake.yml --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2a551161..2be6e362 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -431,6 +431,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: release_name: obs-midi ALPHA 2 ${{ env.GIT_HASH }} + tag_name: Alpha ${{ env.GIT_HASH }} draft: true prerelease: true - name: 'Download release artifacts' From e4c56a9e5a884ddc1dd0d9041402975235e0852c Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 18:03:20 -0500 Subject: [PATCH 36/53] Fix path --- .github/workflows/cmake.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2be6e362..ff74ea56 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -431,7 +431,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: release_name: obs-midi ALPHA 2 ${{ env.GIT_HASH }} - tag_name: Alpha ${{ env.GIT_HASH }} draft: true prerelease: true - name: 'Download release artifacts' @@ -451,7 +450,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}obs-midi/release/obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe + asset_path: ${{ github.workspace }}/obs-midi/release/obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_name: obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_content_type: application/zip - name: 'Upload Linux artifact to release' @@ -460,7 +459,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}obs-midi/release/obs-midi_${{ env.GIT_HASH }}-1_amd64.deb + asset_path: ${{ github.workspace }}/obs-midi/release/obs-midi_${{ env.GIT_HASH }}-1_amd64.deb asset_name: obs-midi-${{ env.GIT_HASH }}-1_amd64.deb asset_content_type: application/octet-stream - name: 'Upload macOS artifact to release' @@ -469,7 +468,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}obs-midi/release/obs-midi-${{ env.GIT_HASH }}-macOS.pkg + asset_path: ${{ github.workspace }}/obs-midi/release/obs-midi-${{ env.GIT_HASH }}-macOS.pkg asset_name: obs-midi-${{ env.GIT_HASH }}-macOS.pkg asset_content_type: application/octet-stream From 28fe535851fa041e1b97565e449cd44f3bad7e24 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 18:33:48 -0500 Subject: [PATCH 37/53] add tag name git hash --- .github/workflows/cmake.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ff74ea56..d3137bbf 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -430,6 +430,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + tag_name: ${{ env.GIT_HASH }} release_name: obs-midi ALPHA 2 ${{ env.GIT_HASH }} draft: true prerelease: true @@ -441,7 +442,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}obs-midi/release/*.zip + asset_path: ${{ github.workspace }}/obs-midi/release/*.zip asset_name: obs-midi-${{ env.GIT_HASH }}-Windows.zip asset_content_type: application/zip - name: 'Upload Windows .exe artifact to release' From 33d97603ad57993fde6a517bc6fcc28ab1af2781 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 19:35:58 -0500 Subject: [PATCH 38/53] new hash tag --- .github/workflows/cmake.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d3137bbf..3cc3b99e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -419,6 +419,14 @@ jobs: runs-on: [ubuntu-latest] needs: [windows, ubuntu64, macos64] steps: + - name: 'Get obs-midi git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-midi + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) - name: 'Get the version' shell: bash id: get_version @@ -430,7 +438,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ env.GIT_HASH }} + tag_name: tag-${{ env.GIT_HASH }} release_name: obs-midi ALPHA 2 ${{ env.GIT_HASH }} draft: true prerelease: true From 4af0a252df51221c0885a281c9086cd21d0d0a0a Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 19:49:36 -0500 Subject: [PATCH 39/53] add checkout --- .github/workflows/cmake.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3cc3b99e..6f9092a7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -419,6 +419,10 @@ jobs: runs-on: [ubuntu-latest] needs: [windows, ubuntu64, macos64] steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-midi - name: 'Get obs-midi git info' shell: bash working-directory: ${{ github.workspace }}/obs-midi From a55345e0caa2247ffab762a97aaae2ed2ac4f333 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 20:07:27 -0500 Subject: [PATCH 40/53] fix paths --- .github/workflows/cmake.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6f9092a7..da9d7322 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -454,7 +454,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/obs-midi/release/*.zip + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-Windows/obs-midi-${{ env.GIT_HASH }}-Windows.zip asset_name: obs-midi-${{ env.GIT_HASH }}-Windows.zip asset_content_type: application/zip - name: 'Upload Windows .exe artifact to release' @@ -463,7 +463,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/obs-midi/release/obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH}}-Windows-Installer/obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_name: obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_content_type: application/zip - name: 'Upload Linux artifact to release' @@ -472,7 +472,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/obs-midi/release/obs-midi_${{ env.GIT_HASH }}-1_amd64.deb + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/obs-midi_${{ env.GIT_HASH }}-1_amd64.deb asset_name: obs-midi-${{ env.GIT_HASH }}-1_amd64.deb asset_content_type: application/octet-stream - name: 'Upload macOS artifact to release' @@ -481,7 +481,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/obs-midi/release/obs-midi-${{ env.GIT_HASH }}-macOS.pkg + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS/obs-midi-${{ env.GIT_HASH }}-macOS.pkg asset_name: obs-midi-${{ env.GIT_HASH }}-macOS.pkg asset_content_type: application/octet-stream From 751efb0c0abd2adbbf2e40641721663cdf3ef57c Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 20:33:20 -0500 Subject: [PATCH 41/53] fix path linux --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index da9d7322..344eeec5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -472,7 +472,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/obs-midi_${{ env.GIT_HASH }}-1_amd64.deb + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/obs-midi-${{ env.GIT_HASH }}-1_amd64.deb asset_name: obs-midi-${{ env.GIT_HASH }}-1_amd64.deb asset_content_type: application/octet-stream - name: 'Upload macOS artifact to release' From 4b273bf34da4e2cbf96d0d4ad26e0c1998683c58 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 21:04:18 -0500 Subject: [PATCH 42/53] fix mac packaging --- .github/workflows/cmake.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 344eeec5..9531414d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -397,6 +397,7 @@ jobs: FILENAME="obs-midi-${{ env.GIT_HASH }}-macOS.pkg" echo "::set-env name=MAC_FILENAME_UNSIGNED::$FILENAME_UNSIGNED" echo "::set-env name=MAC_FILENAME::$FILENAME" + - name: 'Fix linked dynamic library paths' if: success() working-directory: ${{ github.workspace }}/obs-midi @@ -407,6 +408,14 @@ jobs: install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-midi.so echo "Dependencies for obs-midi" otool -L ./build/obs-midi.so + - name: 'package file' + if: success() + working-directory: ./obs-websocket + shell: bash + run: | + set -e + packagesbuild ./CI/macos/obs-websocket.pkgproj + mv ./release/obs-websocket.pkg ./release/${{ env.MAC_FILENAME_UNSIGNED }} - name: 'Publish ${{ env.MAC_FILENAME }} artifact' if: success() uses: actions/upload-artifact@v2-preview @@ -472,7 +481,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/obs-midi-${{ env.GIT_HASH }}-1_amd64.deb + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/*.deb asset_name: obs-midi-${{ env.GIT_HASH }}-1_amd64.deb asset_content_type: application/octet-stream - name: 'Upload macOS artifact to release' From 9097aca1656ae87463c315c3e1636872c977f6a5 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 21:15:34 -0500 Subject: [PATCH 43/53] oops rename directories --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9531414d..6ce89ad0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -410,12 +410,12 @@ jobs: otool -L ./build/obs-midi.so - name: 'package file' if: success() - working-directory: ./obs-websocket + working-directory: ./obs-midi shell: bash run: | set -e - packagesbuild ./CI/macos/obs-websocket.pkgproj - mv ./release/obs-websocket.pkg ./release/${{ env.MAC_FILENAME_UNSIGNED }} + packagesbuild ./CI/macos/obs-midi.pkgproj + mv ./release/obs-midi.pkg ./release/${{ env.MAC_FILENAME_UNSIGNED }} - name: 'Publish ${{ env.MAC_FILENAME }} artifact' if: success() uses: actions/upload-artifact@v2-preview From d14f13027aa238353c3ba0e5e5c691d76020b403 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 21:32:20 -0500 Subject: [PATCH 44/53] rearrange --- .github/workflows/cmake.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6ce89ad0..97c544fa 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -475,22 +475,22 @@ jobs: asset_path: ${{ github.workspace }}/${{ env.GIT_HASH}}-Windows-Installer/obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_name: obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_content_type: application/zip - - name: 'Upload Linux artifact to release' + + - name: 'Upload macOS artifact to release' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/*.deb - asset_name: obs-midi-${{ env.GIT_HASH }}-1_amd64.deb + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS/obs-midi-${{ env.GIT_HASH }}-macOS.pkg + asset_name: obs-midi-${{ env.GIT_HASH }}-macOS.pkg asset_content_type: application/octet-stream - - name: 'Upload macOS artifact to release' + - name: 'Upload Linux artifact to release' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS/obs-midi-${{ env.GIT_HASH }}-macOS.pkg - asset_name: obs-midi-${{ env.GIT_HASH }}-macOS.pkg + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/obs-midi-${{ env.GIT_HASH }}-1_amd64.deb + asset_name: obs-midi-${{ env.GIT_HASH }}-1_amd64.deb asset_content_type: application/octet-stream - From 7fc6dab997ffde6bb96a99da9746c7f9b505e23c Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 21:46:12 -0500 Subject: [PATCH 45/53] ls -la --- .github/workflows/cmake.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 97c544fa..4002a66d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -475,7 +475,13 @@ jobs: asset_path: ${{ github.workspace }}/${{ env.GIT_HASH}}-Windows-Installer/obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_name: obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe asset_content_type: application/zip - + - name: 'check out directories' + shell: bash + working-directory: ${{ github.workspace }}/obs-midi + run: | + cd ${{ github.workspace }} + ls -la + - name: 'Upload macOS artifact to release' uses: actions/upload-release-asset@v1 env: From 53c0918855f386201349d7bfe108c2c1e2baef24 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 21:48:54 -0500 Subject: [PATCH 46/53] Create releasehead.md --- docs/releasehead.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/releasehead.md diff --git a/docs/releasehead.md b/docs/releasehead.md new file mode 100644 index 00000000..898d269b --- /dev/null +++ b/docs/releasehead.md @@ -0,0 +1,13 @@ +# OBS-MIDI +Use MIDI devices to trigger events in OBS and visa versa. + +# More information + +Take a look at the base repo for More information + +# Currently a WIP +Windows and Linux are tested working. Mac has not been tested + # Special thanks to the following projects + * [RTMidi17](https://github.com/jcelerier/RtMidi17) An amazing modernized RTMIDI library + * [OBSWebsocket](https://github.com/Palakis/obs-websocket/) from which much code was borrowed for interfacing with obs + * [MIDItoOBS](https://github.com/lebaston100/MIDItoOBS) Where I got my start playing with this From b7d4ed80ae7f753bf843911a85e2d2daf0bfad37 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 21:51:49 -0500 Subject: [PATCH 47/53] release head --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4002a66d..480d82bf 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -452,6 +452,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: tag-${{ env.GIT_HASH }} + body_path: ${{ github.workspace }}/obs-midi/docs/releasehead.md release_name: obs-midi ALPHA 2 ${{ env.GIT_HASH }} draft: true prerelease: true From 8bc470807cedee1e8af3b1ec6cdddf83c4e341f8 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 22:01:24 -0500 Subject: [PATCH 48/53] more ls --- .github/workflows/cmake.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 480d82bf..3669a1b8 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -482,7 +482,10 @@ jobs: run: | cd ${{ github.workspace }} ls -la - + echo "linux" + ls -la ${{ github.workspace }}/${{ env.GIT_HASH }}-linux + echo "macos" + ls -la ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS - name: 'Upload macOS artifact to release' uses: actions/upload-release-asset@v1 env: From 1e43a0cdc7c13fae6c7aa0a95c0bd25cd0cd3aa8 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 22:15:59 -0500 Subject: [PATCH 49/53] more bits of fix --- .github/workflows/cmake.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3669a1b8..c3fdf7ba 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -486,14 +486,15 @@ jobs: ls -la ${{ github.workspace }}/${{ env.GIT_HASH }}-linux echo "macos" ls -la ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS + mv ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/*.deb ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/obs-midi-${{ env.GIT_HASH }}-1_amd64.deb - name: 'Upload macOS artifact to release' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS/obs-midi-${{ env.GIT_HASH }}-macOS.pkg - asset_name: obs-midi-${{ env.GIT_HASH }}-macOS.pkg + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS/obs-midi-${{ env.GIT_HASH }}-macOS-Unsigned.pkg + asset_name: obs-midi-${{ env.GIT_HASH }}-macOS-Unsigned.pkg asset_content_type: application/octet-stream - name: 'Upload Linux artifact to release' uses: actions/upload-release-asset@v1 From c407d64996a18336b0ff55dd4e1dfb755af41224 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 22:37:34 -0500 Subject: [PATCH 50/53] Update and rename cmake.yml to CI Build and release.yml --- .github/workflows/{cmake.yml => CI Build and release.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{cmake.yml => CI Build and release.yml} (99%) diff --git a/.github/workflows/cmake.yml b/.github/workflows/CI Build and release.yml similarity index 99% rename from .github/workflows/cmake.yml rename to .github/workflows/CI Build and release.yml index c3fdf7ba..f04ebab1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/CI Build and release.yml @@ -454,7 +454,7 @@ jobs: tag_name: tag-${{ env.GIT_HASH }} body_path: ${{ github.workspace }}/obs-midi/docs/releasehead.md release_name: obs-midi ALPHA 2 ${{ env.GIT_HASH }} - draft: true + draft: false prerelease: true - name: 'Download release artifacts' uses: actions/download-artifact@v2-preview From 809764d23f12fbeaabf4f0741a8b1c291e8aeb10 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 22:46:56 -0500 Subject: [PATCH 51/53] Update README.md --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 90d6d872..8e5fd8a1 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,7 @@ Use MIDI devices to trigger events in OBS and visa versa. # Status -- WIP -## Windows -[![Build Status](https://dev.azure.com/cpyarger0055/OBS-Midi/_apis/build/status/OBS-Midi?branchName=master&jobName=Build_Windows)](https://dev.azure.com/cpyarger0055/OBS-Midi/_build/latest?definitionId=5&branchName=master) -## macOS -[![Build Status](https://dev.azure.com/cpyarger0055/OBS-Midi/_apis/build/status/OBS-Midi?branchName=master&jobName=Build_macOS)](https://dev.azure.com/cpyarger0055/OBS-Midi/_build/latest?definitionId=5&branchName=master) -## Linux -[![Build Status](https://dev.azure.com/cpyarger0055/OBS-Midi/_apis/build/status/OBS-Midi?branchName=master&jobName=Build_Linux)](https://dev.azure.com/cpyarger0055/OBS-Midi/_build/latest?definitionId=5&branchName=master) +![CI Multiplatform Build](https://github.com/cpyarger/obs-midi/workflows/CI%20Multiplatform%20Build/badge.svg) # Installing From 6e776653a7a7262399b2eb3ab635071bdcfc6927 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 23:16:41 -0500 Subject: [PATCH 52/53] change Linux version from get tag to get hash --- .github/workflows/CI Build and release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI Build and release.yml b/.github/workflows/CI Build and release.yml index f04ebab1..d5cc5408 100644 --- a/.github/workflows/CI Build and release.yml +++ b/.github/workflows/CI Build and release.yml @@ -284,7 +284,7 @@ jobs: working-directory: ${{ github.workspace }}/obs-midi shell: bash run: | - VERSION="${{ env.GIT_TAG }}" + VERSION="${{ env.GIT_HASH }}" cd ./build sudo checkinstall -y --type=debian --fstrans=no -nodoc \ --backup=no --deldoc=yes --install=no --pkgname=obs-midi --pkgversion=$VERSION \ From 09cfc7bf67036ef06cff64226e7ecf23a98ba7e7 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Sun, 7 Feb 2021 23:47:05 -0500 Subject: [PATCH 53/53] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 3f27bedf..54bf17df 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -github: [alzy, cpyarger] +github: [cpyarger]