From a37cfb3e5b9f21111e72af0b74c5a74bcd624e87 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 28 Aug 2021 07:10:03 -0700 Subject: [PATCH 1/4] WebSocketProtocol: Fix Identified OpCode responses --- src/WebSocketProtocol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WebSocketProtocol.cpp b/src/WebSocketProtocol.cpp index 56b1aa35..94600e44 100644 --- a/src/WebSocketProtocol.cpp +++ b/src/WebSocketProtocol.cpp @@ -133,7 +133,7 @@ void WebSocketProtocol::ProcessMessage(SessionPtr session, WebSocketProtocol::Pr Utils::Platform::SendTrayNotification(QSystemTrayIcon::Information, title, body); } - ret.result["op"] = 3; + ret.result["op"] = 2; ret.result["d"]["negotiatedRpcVersion"] = session->RpcVersion(); } return; case 3: { // Reidentify @@ -144,7 +144,7 @@ void WebSocketProtocol::ProcessMessage(SessionPtr session, WebSocketProtocol::Pr return; } - ret.result["op"] = 3; + ret.result["op"] = 2; ret.result["d"]["negotiatedRpcVersion"] = session->RpcVersion(); } return; case 6: { // Request From d7d69690922b1b6457f90590c153d54568cd910f Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 28 Aug 2021 22:01:17 -0700 Subject: [PATCH 2/4] CI: Add release builds for Windows + Linux Also updates badges on README --- .github/workflows/main.yml | 48 +++++++++++++++++++++++++++----------- README.md | 2 +- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2712501e..c6bdbe65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,8 @@ on: - 'docs/**' branches: - master + tags: + - '[45].[0-9]+.[0-9]+*' pull_request: paths-ignore: - 'docs/**' @@ -44,7 +46,6 @@ jobs: 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: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' @@ -58,9 +59,14 @@ jobs: working-directory: ${{ github.workspace }}/obs-websocket run: | git fetch --prune --unshallow - echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + if [ "${{ env.GIT_TAG }}" ] ; then \ + VERSION="${{ env.GIT_TAG }}" ; \ + else \ + VERSION="${{ env.GIT_HASH }}-git" ; \ + fi + echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - name: 'Restore Cached Qt' id: qtcache uses: actions/cache@v2 @@ -156,7 +162,11 @@ jobs: - name: 'Set PR Artifact Filename' shell: bash run: | - FILENAME="obs-websocket-${{ env.GIT_HASH }}-Windows" + if [ "${{ env.GIT_TAG }}" ] ; then \ + FILENAME="obs-websocket-${{ env.GIT_TAG }}-Windows" ; \ + else \ + FILENAME="obs-websocket-${{ env.GIT_HASH }}-git-Windows" ; \ + fi echo "WIN_FILENAME=$FILENAME" >> $GITHUB_ENV - name: 'Package obs-websocket' working-directory: ${{ github.workspace }}/obs-websocket @@ -175,7 +185,7 @@ jobs: if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_HASH }}-Windows-Installer' + name: 'obs-websocket-${{ env.PACKAGE_VERSION }}-Windows-Installer' path: ${{ github.workspace }}/obs-websocket/package/*.exe ubuntu64: name: "Linux/Ubuntu 64-bit" @@ -198,7 +208,6 @@ jobs: 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: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' @@ -211,9 +220,14 @@ jobs: working-directory: ${{ github.workspace }}/obs-websocket run: | git fetch --prune --unshallow - echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + if [ "${{ env.GIT_TAG }}" ] ; then \ + VERSION="${{ env.GIT_TAG }}" ; \ + else \ + VERSION="${{ env.GIT_HASH }}-git" ; \ + fi + echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - name: 'Install prerequisites (Apt)' shell: bash run: | @@ -294,7 +308,11 @@ jobs: run: | mkdir ./build cd ./build - cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=TRUE .. + if [ "${{ env.GIT_TAG }}" ] ; then \ + cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=TRUE -DCMAKE_BUILD_TYPE=Release .. ; \ + else \ + cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=TRUE .. ; \ + fi - name: 'Build obs-websocket' working-directory: ${{ github.workspace }}/obs-websocket shell: bash @@ -305,26 +323,30 @@ jobs: - name: 'Set PR Artifact Filename' shell: bash run: | - FILENAME="obs-websocket-1-${{ env.GIT_HASH }}-1_amd64.deb" + if [ "${{ env.GIT_TAG }}" ] ; then \ + FILENAME="obs-websocket-${{ env.GIT_TAG }}-Ubuntu64.deb" ; \ + else \ + FILENAME="obs-websocket-${{ env.GIT_HASH }}-git-Ubuntu64.deb" ; \ + fi echo "FILENAME=$FILENAME" >> $GITHUB_ENV - name: 'Package ${{ env.FILENAME }}' if: success() working-directory: ${{ github.workspace }}/obs-websocket shell: bash run: | - VERSION="1-${{ env.GIT_HASH }}-git" cd ./build sudo checkinstall -y --type=debian --fstrans=no -nodoc \ - --backup=no --deldoc=yes --install=no --pkgname=obs-websocket --pkgversion=$VERSION \ + --backup=no --deldoc=yes --install=no --pkgname=obs-websocket --pkgversion=${{ env.PACKAGE_VERSION }} \ --pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \ --pkgsource="${{ github.event.repository.html_url }}" \ - --requires="obs-studio,libqt5core5a,libqt5widgets5,libqt5network5,libqt5concurrent5,qt5-image-formats-plugins" \ + --requires="obs-studio,libqt5network5,libqt5concurrent5,qt5-image-formats-plugins" \ --pakdir="../package" sudo chmod ao+r ../package/* + sudo mv ../package/* ../package/${{ env.FILENAME }} cd - - name: 'Publish ${{ env.FILENAME }}' if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_HASH }}-Ubuntu64' - path: '${{ github.workspace }}/obs-websocket/package/*.deb' \ No newline at end of file + name: 'obs-websocket-${{ env.PACKAGE_VERSION }}-Ubuntu64' + path: '${{ github.workspace }}/obs-websocket/package/*.deb' diff --git a/README.md b/README.md index c527056a..bfa90ac7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ WebSockets API for OBS Studio. -[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40LePalakis)](https://twitter.com/LePalakis) +[![CI Multiplatform Build](https://github.com/Palakis/obs-websocket/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Palakis/obs-websocket/actions/workflows/main.yml) [![Discord](https://img.shields.io/discord/715691013825364120.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/WBaSQ3A) [![Financial Contributors on Open Collective](https://opencollective.com/obs-websocket/all/badge.svg?label=financial+contributors)](https://opencollective.com/obs-websocket) From 0b02b7453e1e8f800b7d6b329eaf772a864411d0 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 28 Aug 2021 23:28:00 -0700 Subject: [PATCH 3/4] Fix package version --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6bdbe65..cdfa898d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,9 +62,9 @@ jobs: echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV if [ "${{ env.GIT_TAG }}" ] ; then \ - VERSION="${{ env.GIT_TAG }}" ; \ + VERSION="$(git describe --tags --abbrev=0)" ; \ else \ - VERSION="${{ env.GIT_HASH }}-git" ; \ + VERSION="$(git rev-parse --short HEAD)-git" ; \ fi echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - name: 'Restore Cached Qt' @@ -223,9 +223,9 @@ jobs: echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV if [ "${{ env.GIT_TAG }}" ] ; then \ - VERSION="${{ env.GIT_TAG }}" ; \ + VERSION="$(git describe --tags --abbrev=0)" ; \ else \ - VERSION="${{ env.GIT_HASH }}-git" ; \ + VERSION="$(git rev-parse --short HEAD)-git" ; \ fi echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - name: 'Install prerequisites (Apt)' From 1849c39c4c4bdc0ecb4d6802573befa28dc5366d Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 28 Aug 2021 23:37:04 -0700 Subject: [PATCH 4/4] CI: Fix git tag recognition --- .github/workflows/main.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cdfa898d..b14ab442 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,12 +59,14 @@ jobs: working-directory: ${{ github.workspace }}/obs-websocket run: | git fetch --prune --unshallow - echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - if [ "${{ env.GIT_TAG }}" ] ; then \ - VERSION="$(git describe --tags --abbrev=0)" ; \ + GIT_HASH=$(git rev-parse --short HEAD) + echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV + GIT_TAG=$(git describe --tags --abbrev=0) + echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV + if [ "$GIT_TAG" ] ; then \ + VERSION="$GIT_TAG" ; \ else \ - VERSION="$(git rev-parse --short HEAD)-git" ; \ + VERSION="$GIT_HASH-git" ; \ fi echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - name: 'Restore Cached Qt' @@ -179,7 +181,7 @@ jobs: if: success() uses: actions/upload-artifact@v2-preview with: - name: '${{ env.GIT_HASH }}-Windows' + name: 'obs-websocket-${{ env.PACKAGE_VERSION }}-Windows' path: ${{ github.workspace }}/obs-websocket/package/*.zip - name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe' if: success() @@ -220,12 +222,14 @@ jobs: working-directory: ${{ github.workspace }}/obs-websocket run: | git fetch --prune --unshallow - echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - if [ "${{ env.GIT_TAG }}" ] ; then \ - VERSION="$(git describe --tags --abbrev=0)" ; \ + GIT_HASH=$(git rev-parse --short HEAD) + echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV + GIT_TAG=$(git describe --tags --abbrev=0) + echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV + if [ "$GIT_TAG" ] ; then \ + VERSION="$GIT_TAG" ; \ else \ - VERSION="$(git rev-parse --short HEAD)-git" ; \ + VERSION="$GIT_HASH-git" ; \ fi echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - name: 'Install prerequisites (Apt)'