|
| 1 | +name: hyperion-obs |
| 2 | +on: [push, pull_request] |
| 3 | + |
| 4 | +jobs: |
| 5 | + Linux: |
| 6 | + name: 'Linux 64bit' |
| 7 | + runs-on: ubuntu-latest |
| 8 | + env: |
| 9 | + obs-studio-version: 25.0.0 |
| 10 | + project-name: hyperion-obs |
| 11 | + project-git: hyperion-obs-plugin |
| 12 | + maintainer: hyperion-project.org |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout hyperion-obs |
| 16 | + uses: actions/checkout@v2 |
| 17 | + with: |
| 18 | + path: ${{ github.workspace }} |
| 19 | + submodules: 'true' |
| 20 | + |
| 21 | + - name: Checkout OBS-Studio |
| 22 | + uses: actions/checkout@v2 |
| 23 | + with: |
| 24 | + repository: obsproject/obs-studio |
| 25 | + path: ${{ github.workspace }}/obs-studio |
| 26 | + submodules: 'true' |
| 27 | + |
| 28 | + - name: Generate environment variables from .version |
| 29 | + shell: bash |
| 30 | + run: echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV |
| 31 | + |
| 32 | + - name: Install Dependencies |
| 33 | + shell: bash |
| 34 | + run: | |
| 35 | + sudo apt-get -qq update |
| 36 | + sudo apt-get install -y libobs-dev git libc-dev-bin libc6-dev build-essential checkinstall cmake qtbase5-dev |
| 37 | +
|
| 38 | + - name: Build plugin |
| 39 | + shell: bash |
| 40 | + run: | |
| 41 | + cmake -S ${{ github.workspace }} -B ${{ github.workspace }}/build -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DOBS_SOURCE=${{ github.workspace }}/obs-studio -DGLOBAL_INSTALLATION=ON |
| 42 | + sudo cmake --build ${{ github.workspace }}/build/ --parallel 4 --target install |
| 43 | +
|
| 44 | + cd ${{github.workspace}}/build |
| 45 | + PAGER="cat" sudo checkinstall -y --type=debian --fstrans=no --nodoc \ |
| 46 | + --backup=no --deldoc=yes --install=no \ |
| 47 | + --pkgname=${{ env.project-name }} --pkgversion=${{ env.VERSION }} \ |
| 48 | + --exclude="/usr/include/flatbuffers,/usr/bin,/usr/lib/x86_64-linux-gnu/cmake,/usr/lib/x86_64-linux-gnu/pkgconfig" \ |
| 49 | + --pkglicense="MIT" --maintainer="${{ env.maintainer }}" \ |
| 50 | + --pkggroup="video" \ |
| 51 | + --pkgsource="https://github.com/${{ env.project-git }}" \ |
| 52 | + --requires="obs-studio \(\>= ${{ env.obs-studio-version }}\)" \ |
| 53 | + --pakdir="${{ github.workspace }}/plugin" |
| 54 | + sudo mv ${{ github.workspace }}/plugin/*.deb ${{ github.workspace }}/plugin/${{ env.project-name }}.${{ env.VERSION }}.linux.x64.deb |
| 55 | +
|
| 56 | + - name: Upload plugin |
| 57 | + if: startsWith(github.event.ref, 'refs/tags') |
| 58 | + uses: actions/upload-artifact@v2 |
| 59 | + with: |
| 60 | + name: hyperion-obs |
| 61 | + path: ${{ github.workspace }}/plugin |
| 62 | + |
| 63 | + Windows: |
| 64 | + name: 'Windows 64bit' |
| 65 | + runs-on: [windows-latest] |
| 66 | + env: |
| 67 | + QT_VERSION: '5.15.2' |
| 68 | + WINDOWS_DEPS_VERSION: '2019' |
| 69 | + CEF_WRAPPER: 'cef_binary_75.1.16+g16a67c4+chromium-75.0.3770.100_windows64_minimal' |
| 70 | + CMAKE_GENERATOR: "Visual Studio 16 2019" |
| 71 | + CMAKE_SYSTEM_VERSION: "10.0" |
| 72 | + project-git: hyperion-obs-plugin |
| 73 | + project-name: hyperion-project.org |
| 74 | + |
| 75 | + steps: |
| 76 | + - name: Checkout hyperion-obs |
| 77 | + uses: actions/checkout@v2 |
| 78 | + with: |
| 79 | + path: ${{ github.workspace }} |
| 80 | + submodules: 'recursive' |
| 81 | + |
| 82 | + - name: 'Checkout OBS-Studio' |
| 83 | + uses: actions/checkout@v2 |
| 84 | + with: |
| 85 | + repository: obsproject/obs-studio |
| 86 | + path: ${{ github.workspace }}/obs-studio |
| 87 | + submodules: 'recursive' |
| 88 | + |
| 89 | + - name: Generate environment variables from .version |
| 90 | + shell: bash |
| 91 | + run: echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV |
| 92 | + |
| 93 | + - name: 'Get OBS-Studio git info' |
| 94 | + shell: bash |
| 95 | + working-directory: ${{ github.workspace }}/obs-studio |
| 96 | + run: | |
| 97 | + git fetch --prune --unshallow |
| 98 | + echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV |
| 99 | +
|
| 100 | + - name: 'Checkout last OBS-Studio release' |
| 101 | + shell: bash |
| 102 | + working-directory: ${{ github.workspace }}/obs-studio |
| 103 | + run: | |
| 104 | + git checkout ${{ env.OBS_GIT_TAG }} |
| 105 | + git submodule update |
| 106 | +
|
| 107 | + - name: 'Install QT' |
| 108 | + run: | |
| 109 | + curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - |
| 110 | + 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT" |
| 111 | +
|
| 112 | + - name: 'Install pre-built OBS dependencies' |
| 113 | + run: | |
| 114 | + curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C - |
| 115 | + 7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}\cmbuild\deps" |
| 116 | + curl -kLO https://cdn-fastly.obsproject.com/downloads/${{ env.CEF_WRAPPER }}.zip -f --retry 5 -C - |
| 117 | + 7z x ${{ env.CEF_WRAPPER }}.zip -o"${{ github.workspace }}\cmbuild" |
| 118 | +
|
| 119 | + - name: Add msbuild to PATH |
| 120 | + |
| 121 | + |
| 122 | + - name: 'Restore OBS build from cache' |
| 123 | + id: build-cache-obs |
| 124 | + uses: actions/cache@v1 |
| 125 | + with: |
| 126 | + path: ${{ github.workspace }}/obs-studio/build |
| 127 | + key: ${{ runner.os }}-build-cache-obs-${{ env.OBS_GIT_TAG }} |
| 128 | + restore-keys: ${{ runner.os }}-build-cache-obs-${{ env.OBS_GIT_TAG }} |
| 129 | + |
| 130 | + - name: 'Configure OBS' |
| 131 | + if: steps.build-cache-obs.outputs.cache-hit != 'true' |
| 132 | + working-directory: ${{ github.workspace }}/obs-studio |
| 133 | + shell: powershell |
| 134 | + run: | |
| 135 | + New-Item -ItemType Directory -Force -Path .\build |
| 136 | + cd .\build |
| 137 | + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCEF_ROOT_DIR="${{ github.workspace }}\cmbuild\${{ env.CEF_WRAPPER }}" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. |
| 138 | +
|
| 139 | + - name: 'Build OBS-Studio' |
| 140 | + if: steps.build-cache-obs.outputs.cache-hit != 'true' |
| 141 | + working-directory: ${{ github.workspace }}/obs-studio |
| 142 | + run: | |
| 143 | + msbuild /m /p:Configuration=RelWithDebInfo .\build\libobs\libobs.vcxproj |
| 144 | + msbuild /m /p:Configuration=RelWithDebInfo .\build\UI\obs-frontend-api\obs-frontend-api.vcxproj |
| 145 | +
|
| 146 | + - name: 'Build hyperion-obs' |
| 147 | + working-directory: ${{ github.workspace }} |
| 148 | + run: | |
| 149 | + mkdir .\build |
| 150 | + cd .\build |
| 151 | + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" ` |
| 152 | + -DOBS_SOURCE="${{ github.workspace }}\obs-studio" ` |
| 153 | + -DOBS_BUILD="${{ github.workspace }}\obs-studio\build" .. |
| 154 | + msbuild /m /p:Configuration=RelWithDebInfo .\hyperion-obs.sln |
| 155 | + env: |
| 156 | + Qt5_DIR: ${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019_64 |
| 157 | + |
| 158 | + - name: 'Package hyperion-obs' |
| 159 | + working-directory: ${{ github.workspace }} |
| 160 | + run: | |
| 161 | + mkdir release\obs-plugins\64bit |
| 162 | + mkdir release\data\obs-plugins\hyperion-obs\ |
| 163 | + robocopy .\build\RelWithDebInfo .\release\obs-plugins\64bit\ hyperion-obs.dll hyperion-obs.pdb |
| 164 | + robocopy /E .\locale .\release\data\obs-plugins\hyperion-obs\locale |
| 165 | + iscc .\build\Windows.iss /O. /F"hyperion-obs.${{ env.VERSION }}.windows.x64" |
| 166 | +
|
| 167 | + - name: Upload plugin |
| 168 | + if: startsWith(github.event.ref, 'refs/tags') |
| 169 | + uses: actions/upload-artifact@v2 |
| 170 | + with: |
| 171 | + name: 'hyperion-obs.${{ env.VERSION }}.windows.x64' |
| 172 | + path: ${{ github.workspace }}/*.exe |
| 173 | + |
| 174 | + github_publish: |
| 175 | + name: Publish GitHub Releases |
| 176 | + if: startsWith(github.event.ref, 'refs/tags') |
| 177 | + needs: [Linux, Windows] |
| 178 | + runs-on: ubuntu-latest |
| 179 | + steps: |
| 180 | + - name: Checkout |
| 181 | + uses: actions/checkout@v2 |
| 182 | + |
| 183 | + - name: Generate environment variables from .version |
| 184 | + shell: bash |
| 185 | + run: echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV |
| 186 | + |
| 187 | + # Download artifacts from previous build process |
| 188 | + - name: Download artifacts |
| 189 | + uses: actions/download-artifact@v2 |
| 190 | + with: |
| 191 | + path: artifacts |
| 192 | + |
| 193 | + # Create draft release and upload artifacts |
| 194 | + - name: Create draft release |
| 195 | + uses: softprops/action-gh-release@v1 |
| 196 | + with: |
| 197 | + name: hyperion-obs ${{ env.VERSION }} |
| 198 | + tag_name: ${{ env.TAG }} |
| 199 | + files: "artifacts/**" |
| 200 | + draft: true |
| 201 | + env: |
| 202 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments