diff --git a/.gitignore b/.gitignore index c60fdf06..b7e57102 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /build32/ /build64/ /release/ +/package/ /installer/Output/ .idea .vscode diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8e712fbb..00000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -language: cpp - -env: - global: - # AWS key ID - - secure: pAiNUGVbjP12BfnWPk0FFTkbnk4Tocvv88XiT3rzRqkQaD7/iyEogLBfHM4nOEgFiIMHbC41aE83w5JgRNPwn6mTgoQBOglzqq1tGuXfqPyV2VStk8beji1evubGoVjjPaoPTFyIdQc5GGxdHyogI/ed9Hb3ccyykYvjyolj9XoCiW42QHx60AHGwl+So+dEa8xydj9SLRPlZ/AitmI/cPVN3YotA7s37BLFiab54enxk7T4rwpR1nU0HVfoCpn5F4wZYxRq+LlSVFzC8vVE9cpDSLS5kjrZIZaT18tYG1/untCj+wqMIZbghaJXLtPSRW2YPHcJTz8q1YSXnJ19+0uiAIMAqaVv0kD5BAM97byYDBW+b9H6SYFkb/Pw/qcK9amMzMBjDPFpYFkl9Q2kzhsNs3HsZf/flSZjtrkQJiP3SOi/KvKzVK9X4Wym6hYZWHgmMTTYFrvr6BYnf2GkpfKNjm1d2kc0NNrq4d5H4NOEQB8MP+QH+o+BPeM6d9dthrUc1Pw+BXzOAr85CN4qtpPGoAl/Dbfgd6eu/88E2LpUufW2VFAOPWjykSOqzSN3orh7AaWuE34VFEnQ+2y3uIE8AKoyXzJv6zYkyNnNewKZeGe2kKYNwLn5UxQA9JEj7a+tvVevk4xBSkkjFAvjSG2z8/F1FXNbEfoLX1Hz/bU= - # AWS key secret - - secure: bGwljoP3E1OVBXLXox0O6p8kwQXLcNQ8YDKVa4H8u9Y+Ic7uqE4iV3rYS3ynNWSBMVRWY3ZbyClnhrCNwRhBAlcd8qWSJdpjVzs6HdQyzhuKa1P3V4FJPb7upGP/5R/DECGwex8Mun9dmXpYDak75LxfKIJUidPis5VDCYqul7k/xVVCou6Ctjpj7vQhWXDj2G/py+mdB8DERhymnQCtyK1Ziu8c4QlFKByZmnD72GFm/h3JPI1Pq1V2mz3x6x6GaYjb9Rdbd0UNwqjGQX4q2M/c3GEJa6B2JBCoTncawNZBNnPUF9qtv+zh0TNaNHMRWX13AJ/qYB+nVDub0C9b/6Mc48mt0Tv4ze15MproVrylZdV6qHYEG8yGPBqpTVbRP6gv6Y2TXIHWoTzqA+F/Gv2IDChyHXsld/MQQS2MSo5iaYktIrZKtX8Z0qAmTzPwIVBromaSI3vrE7UH0fRSQ6fAM8+Tn+MRthOBdqu23kS1dnG+X2CPbUhBfsJp0OSwVQD5jQtA51/sREVeGFiJvzQIkvwQDjb5MYilsRnwmoBXemkLmqaviXVY4rz1o5AIvz2pgZS2YggK1xHZCuI5tSjcNEkb77VwZTfsqrdDo9EJh6VgfdnGlHQhR2/A5hUJ4ANpJ/LgZlgfVp71Xg2GWQW6M4Znc5uj6A6xLBkO6FA= - -cache: - directories: - - node_modules - -matrix: - include: - - os: linux - env: _generate_docs - script: "./CI/generate-docs.sh" - - - os: linux - env: _linux_build - dist: trusty - sudo: required - services: - - docker - before_install: - - docker run -d --name xenial -v $(dirname $(pwd)):/root -v /home/travis/package:/package - -e TRAVIS_BRANCH="$TRAVIS_BRANCH" -e TRAVIS_TAG="$TRAVIS_TAG" -w /root nimmis/ubuntu:16.04 - - docker exec -it xenial /root/obs-websocket/CI/install-dependencies-xenial.sh - script: - - docker exec -it xenial /root/obs-websocket/CI/build-xenial.sh - after_success: - - docker exec -it xenial /root/obs-websocket/CI/package-xenial.sh - -deploy: -- provider: s3 - region: eu-central-1 - bucket: obs-websocket-linux-builds - access_key_id: "$AWS_ID" - secret_access_key: "$AWS_SECRET" - local_dir: /home/travis/package - skip_cleanup: true - acl: public_read - on: - repo: Palakis/obs-websocket - condition: - - "$TRAVIS_OS_NAME = linux" - - "-d /home/travis/package" - all_branches: true diff --git a/CI/build-xenial.sh b/CI/build-ubuntu.sh similarity index 78% rename from CI/build-xenial.sh rename to CI/build-ubuntu.sh index cc7e53ef..b19158ae 100755 --- a/CI/build-xenial.sh +++ b/CI/build-ubuntu.sh @@ -1,8 +1,6 @@ #!/bin/sh set -ex -cd /root/obs-websocket - mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=/usr .. make -j4 diff --git a/CI/install-build-obs.cmd b/CI/checkout-cmake-obs-windows.cmd similarity index 50% rename from CI/install-build-obs.cmd rename to CI/checkout-cmake-obs-windows.cmd index 9f73b3e0..0fc6c12c 100644 --- a/CI/install-build-obs.cmd +++ b/CI/checkout-cmake-obs-windows.cmd @@ -18,25 +18,25 @@ REM Set up the build flag as undefined. set "BuildOBS=" REM Check the last tag successfully built by CI. -if exist C:\projects\obs-studio-last-tag-built.txt ( - set /p OBSLastTagBuilt= C:\projects\latest-obs-studio-tag-pre-pull.txt - set /p OBSLatestTagPrePull= "%OBSPath%\latest-obs-studio-tag-pre-pull.txt" + set /p OBSLatestTagPrePull=<"%OBSPath%\latest-obs-studio-tag-pre-pull.txt" git checkout master git pull - git describe --tags --abbrev=0 --exclude="*-rc*" > C:\projects\latest-obs-studio-tag-post-pull.txt - set /p OBSLatestTagPostPull= C:\projects\latest-obs-studio-tag.txt + git describe --tags --abbrev=0 --exclude="*-rc*" > "%OBSPath%\latest-obs-studio-tag-post-pull.txt" + set /p OBSLatestTagPostPull=<"%OBSPath%\latest-obs-studio-tag-post-pull.txt" + set /p OBSLatestTag=<"%OBSPath%\latest-obs-studio-tag-post-pull.txt" + echo %OBSLatestTagPostPull%> "%OBSPath%\latest-obs-studio-tag.txt" ) REM Check the obs-studio tags for mismatches. @@ -58,22 +58,22 @@ if not %OBSLatestTagPostPull%==%OBSLastTagBuilt% ( REM If obs-studio directory does not exist, clone the git repo, get the latest REM tag number, and set the build flag. -if not exist C:\projects\obs-studio ( +if not exist %OBSPath% ( echo obs-studio directory does not exist - git clone https://github.com/obsproject/obs-studio - cd C:\projects\obs-studio\ - git describe --tags --abbrev=0 --exclude="*-rc*" > C:\projects\obs-studio-latest-tag.txt - set /p OBSLatestTag= "%OBSPath%\obs-studio-latest-tag.txt" + set /p OBSLatestTag=<"%OBSPath%\obs-studio-latest-tag.txt" set BuildOBS=true ) REM If the needed obs-studio libs for this build_config do not exist, REM set the build flag. -if not exist C:\projects\obs-studio\build32\libobs\%build_config%\obs.lib ( +if not exist %OBSPath%\build32\libobs\%build_config%\obs.lib ( echo obs-studio\build32\libobs\%build_config%\obs.lib does not exist set BuildOBS=true ) -if not exist C:\projects\obs-studio\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib ( +if not exist %OBSPath%\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib ( echo obs-studio\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib does not exist set BuildOBS=true ) @@ -95,35 +95,43 @@ echo: REM If the build flag is set, build obs-studio. if defined BuildOBS ( echo Building obs-studio... + cd /D %OBSPath% echo git checkout %OBSLatestTag% git checkout %OBSLatestTag% echo: - echo Removing previous build dirs... - if exist build rmdir /s /q C:\projects\obs-studio\build - if exist build32 rmdir /s /q C:\projects\obs-studio\build32 - if exist build64 rmdir /s /q C:\projects\obs-studio\build64 - echo Making new build dirs... - mkdir build + + echo Removing previous build dirs... + if exist build32 rmdir /s /q "%OBSPath%\build32" + if exist build64 rmdir /s /q "%OBSPath%\build64" + + echo Making new build dirs... mkdir build32 mkdir build64 - echo Running cmake for obs-studio %OBSLatestTag% 32-bit... - cd ./build32 - cmake -G "Visual Studio 14 2015" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. + + echo Running cmake for obs-studio %OBSLatestTag% 32-bit... + cd build32 + cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DDepsPath="%DepsPath32%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. echo: echo: - echo Running cmake for obs-studio %OBSLatestTag% 64-bit... - cd ../build64 - cmake -G "Visual Studio 14 2015 Win64" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. + + echo Running cmake for obs-studio %OBSLatestTag% 64-bit... + cd ..\build64 + cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DDepsPath="%DepsPath64%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. echo: echo: - echo Building obs-studio %OBSLatestTag% 32-bit ^(Build Config: %build_config%^)... - call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build32\obs-studio.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - echo Building obs-studio %OBSLatestTag% 64-bit ^(Build Config: %build_config%^)... - call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build64\obs-studio.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - cd .. - git describe --tags --abbrev=0 > C:\projects\obs-studio-last-tag-built.txt - set /p OBSLastTagBuilt= "%OBSPath%\obs-studio-last-tag-built.txt" + set /p OBSLastTagBuilt=<"%OBSPath%\obs-studio-last-tag-built.txt" ) else ( echo Last OBS tag built is: %OBSLastTagBuilt% echo No need to rebuild OBS. ) + +dir "%OBSPath%\libobs" diff --git a/CI/download-obs-deps.cmd b/CI/download-obs-deps.cmd new file mode 100644 index 00000000..ff4ffd57 --- /dev/null +++ b/CI/download-obs-deps.cmd @@ -0,0 +1,6 @@ +if not exist %DepsBasePath% ( + curl -o %DepsBasePath%.zip -kLO https://obsproject.com/downloads/dependencies2017.zip -f --retry 5 -C - + 7z x %DepsBasePath%.zip -o%DepsBasePath% +) else ( + echo "OBS dependencies are already there. Download skipped." +) diff --git a/CI/generate-docs.sh b/CI/generate-docs.sh index 5e7d6d01..bb1d3dfd 100755 --- a/CI/generate-docs.sh +++ b/CI/generate-docs.sh @@ -4,6 +4,9 @@ echo "-- Generating documentation." echo "-- Node version: $(node -v)" echo "-- NPM version: $(npm -v)" +git fetch origin +git checkout ${CHECKOUT_REF/refs\/heads\//} + cd docs npm install npm run build @@ -15,19 +18,14 @@ if git diff --quiet; then exit 0 fi -if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "4.x-current" ]; then - echo "-- Skipping documentation deployment because this is either a pull request or a non-master branch." - exit 0 -fi - REMOTE_URL="$(git config remote.origin.url)" TARGET_REPO=${REMOTE_URL/https:\/\/github.com\//github.com/} GITHUB_REPO=https://${GH_TOKEN:-git}@${TARGET_REPO} -git config user.name "Travis CI" +git config user.name "Azure CI" git config user.email "$COMMIT_AUTHOR_EMAIL" git add ./generated git pull -git commit -m "docs(travis): Update protocol.md - $(git rev-parse --short HEAD) [skip ci]" -git push -q $GITHUB_REPO HEAD:$TRAVIS_BRANCH +git commit -m "docs(ci): Update protocol.md - $(git rev-parse --short HEAD) [skip ci]" +git push -q $GITHUB_REPO diff --git a/CI/install-dependencies-ubuntu.sh b/CI/install-dependencies-ubuntu.sh new file mode 100755 index 00000000..d0e16f53 --- /dev/null +++ b/CI/install-dependencies-ubuntu.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -ex + +sudo add-apt-repository -y ppa:obsproject/obs-studio +sudo apt-get -qq update + +sudo apt-get install -y \ + libc-dev-bin \ + libc6-dev git \ + build-essential \ + checkinstall \ + cmake \ + obs-studio \ + qtbase5-dev + +# Dirty hack +sudo wget -O /usr/include/obs/obs-frontend-api.h https://raw.githubusercontent.com/obsproject/obs-studio/25.0.0/UI/obs-frontend-api/obs-frontend-api.h + +sudo ldconfig diff --git a/CI/install-dependencies-xenial.sh b/CI/install-dependencies-xenial.sh deleted file mode 100755 index c55d82d7..00000000 --- a/CI/install-dependencies-xenial.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -set -ex - -add-apt-repository -y ppa:obsproject/obs-studio -apt-get -qq update - -apt-get install -y \ - libc-dev-bin \ - libc6-dev git \ - build-essential \ - checkinstall \ - cmake \ - obs-studio \ - qtbase5-dev - -# Dirty hack -wget -O /usr/include/obs/obs-frontend-api.h https://raw.githubusercontent.com/obsproject/obs-studio/25.0.0/UI/obs-frontend-api/obs-frontend-api.h - -ldconfig diff --git a/CI/install-qt-win.cmd b/CI/install-qt-win.cmd new file mode 100644 index 00000000..e0537fe8 --- /dev/null +++ b/CI/install-qt-win.cmd @@ -0,0 +1,8 @@ +if not exist %QtBaseDir% ( + curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_5.10.1.7z -f --retry 5 -z Qt_5.10.1.7z + 7z x Qt_5.10.1.7z -o%QtBaseDir% +) else ( + echo "Qt is already installed. Download skipped." +) + +dir %QtBaseDir% diff --git a/CI/install-setup-qt.cmd b/CI/install-setup-qt.cmd deleted file mode 100644 index e7dc3784..00000000 --- a/CI/install-setup-qt.cmd +++ /dev/null @@ -1,6 +0,0 @@ -@echo off - -REM Set default values to use AppVeyor's built-in Qt. -set QTDIR32=C:\Qt\5.10.1\msvc2015 -set QTDIR64=C:\Qt\5.10.1\msvc2015_64 -set QTCompileVersion=5.10.1 diff --git a/CI/package-macos.sh b/CI/package-macos.sh index b68c40a8..5210ba5b 100755 --- a/CI/package-macos.sh +++ b/CI/package-macos.sh @@ -19,7 +19,6 @@ export VERSION="$GIT_HASH-$GIT_BRANCH_OR_TAG" export LATEST_VERSION="$GIT_BRANCH_OR_TAG" export FILENAME="obs-websocket-$VERSION.pkg" -export LATEST_FILENAME="obs-websocket-latest-$LATEST_VERSION.pkg" echo "[obs-websocket] Modifying obs-websocket.so" install_name_tool \ @@ -40,4 +39,3 @@ packagesbuild ./CI/macos/obs-websocket.pkgproj echo "[obs-websocket] Renaming obs-websocket.pkg to $FILENAME" mv ./release/obs-websocket.pkg ./release/$FILENAME -cp ./release/$FILENAME ./release/$LATEST_FILENAME diff --git a/CI/package-ubuntu.sh b/CI/package-ubuntu.sh new file mode 100755 index 00000000..367e002c --- /dev/null +++ b/CI/package-ubuntu.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +export GIT_HASH=$(git rev-parse --short HEAD) +export PKG_VERSION="1-$GIT_HASH-$BRANCH_SHORT_NAME-git" + +if [[ "$BRANCH_FULL_NAME" =~ "^refs/tags/" ]]; then + export PKG_VERSION="$BRANCH_SHORT_NAME" +fi + +cd ./build + +PAGER="cat" sudo checkinstall -y --type=debian --fstrans=no --nodoc \ + --backup=no --deldoc=yes --install=no \ + --pkgname=obs-websocket --pkgversion="$PKG_VERSION" \ + --pkglicense="GPLv2.0" --maintainer="stephane.lepin@gmail.com" \ + --pkggroup="video" \ + --pkgsource="https://github.com/Palakis/obs-websocket" \ + --requires="obs-studio,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \ + --pakdir="../package" + +sudo chmod ao+r ../package/* diff --git a/CI/package-windows.cmd b/CI/package-windows.cmd new file mode 100644 index 00000000..fe752995 --- /dev/null +++ b/CI/package-windows.cmd @@ -0,0 +1,12 @@ +mkdir package +cd package + +git rev-parse --short HEAD > package-version.txt +set /p PackageVersion=