Skip to content

refactor(rtsp-output): Removed redundant code. #466

refactor(rtsp-output): Removed redundant code.

refactor(rtsp-output): Removed redundant code. #466

Workflow file for this run

name: 'CI Release'
on:
#release:
# types: [published]
push:
tags:
- v[1-9].[0-9]+.[0-9]+
- v[1-9][0-9]+.[0-9]+.[0-9]+
- v[1-9].[0-9]+.[0-9]+-[a-z0-9]+
- v[1-9][0-9]+.[0-9]+.[0-9]+-[a-z0-9]+
env:
PRODUCT_NAME: 'obs-rtspserver'
DEPS_VERSION_MAC: '2023-11-03'
DEPS_HASH_MAC: '90c2fc069847ec2768dcc867c1c63b112c615ed845a907dc44acab7a97181974'
#QT_VERSION_MAC: '2022-02-13'
QT_HASH_MAC: 'ba4a7152848da0053f63427a2a2cb0a199af3992997c0db08564df6f48c9db98'
DEPS_VERSION_WIN: '2023-11-03'
DEPS_X64_HASH_WIN: 'd0825a6fb65822c993a3059edfba70d72d2e632ef74893588cf12b1f0d329ce6'
DEPS_X86_HASH_WIN: 'b69c864275189464483c240ef3f25ea16fba3050b136fe6c3db6e9ee63036683'
QT_X64_HASH_WIN: 'bc57dedf76b47119a6dce0435a2f21b35b08c8f2948b1cb34a157320f77732d1'
QT_X86_HASH_WIN: '50129f9836ef987c23db2e0535085fa2d52474ef0de44bc11c9df6cfa602b785'
#QT_VERSION_WIN: '5.15.2'
NSIS_VERSION_WIN: '3.09'
jobs:
get_obs_info:
name: '01 - Get obs-studio last release info'
runs-on: [ubuntu-latest]
outputs:
latest_id: ${{ steps.latest_release.outputs.id }}
latest_url: ${{ steps.latest_release.outputs.url }}
latest_html_url: ${{ steps.latest_release.outputs.html_url }}
latest_upload_url: ${{ steps.latest_release.outputs.upload_url }}
latest_name: ${{ steps.latest_release.outputs.name }}
latest_tag_name: ${{ steps.latest_release.outputs.tag_name }}
latest_target_commitish: ${{ steps.latest_release.outputs.target_commitish }}
latest_created_at: ${{ steps.latest_release.outputs.created_at }}
latest_published_at: ${{ steps.latest_release.outputs.published_at }}
steps:
- name: Get latest release info
id: latest_release
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo: 'obsproject/obs-studio'
latest: true
get_plugin_info:
name: '01 - Get plugin git info'
runs-on: [ubuntu-latest]
outputs:
git_tag_name: ${{ steps.tag_name.outputs.tag }}
steps:
- name: 'Get plugin git tag'
uses: devops-actions/[email protected]
id: tag_name
clang_check:
name: '02 - Code format check'
runs-on: [ubuntu-latest]
needs: [get_plugin_info]
steps:
- name: 'Checkout plugin ${{ needs.get_plugin_info.outputs.git_tag_name }}'
uses: actions/checkout@v4
with:
path: 'plugin'
ref: '${{ needs.get_plugin_info.outputs.git_tag_name }}'
submodules: 'recursive'
- name: 'Install clang-format'
run: sudo apt-get install -y clang-format-12
- name: 'Run clang-format'
working-directory: 'plugin'
run: |
source CI/utility/formatcode.sh
source CI/utility/check-format.sh
windows_build:
name: '03 - Windows (Latest)'
runs-on: [windows-2022]
needs: [get_obs_info, get_plugin_info, clang_check]
strategy:
matrix:
arch: [64, 32]
env:
#CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_SYSTEM_VERSION: "10.0.22000.0"
OBS_VERSION: "${{ needs.get_obs_info.outputs.latest_tag_name }}"
steps:
- name: 'Add msbuild to PATH'
uses: microsoft/setup-msbuild@v1
- name: 'Checkout plugin ${{ needs.get_plugin_info.outputs.git_tag_name }}'
uses: actions/checkout@v4
with:
path: 'plugin'
ref: '${{ needs.get_plugin_info.outputs.git_tag_name }}'
submodules: 'recursive'
- name: 'Checkout OBS v${{ needs.get_obs_info.outputs.latest_tag_name }}'
uses: actions/checkout@v4
with:
repository: obsproject/obs-studio
path: 'obs-studio'
ref: '${{ needs.get_obs_info.outputs.latest_tag_name }}'
fetch-depth: 0
submodules: 'recursive'
- name: "Install Dependencies"
working-directory: 'plugin'
run: CI/windows/01_install_dependencies.ps1 -BuildArch ${{ matrix.arch }}-bit -NoChoco -InstallList "obs-deps","qt-deps","obs-studio"
- name: 'Build libobs and obs-frontend-api'
working-directory: 'plugin'
run: CI/windows/02_build_obs_libs.ps1 -BuildArch "${{ matrix.arch }}-bit"
- name: 'Build plugin'
working-directory: 'plugin'
run: CI/windows/03_build_plugin.ps1 -BuildArch "${{ matrix.arch }}-bit"
- name: 'Create build artifact'
working-directory: 'plugin'
run: CI/windows/04_package_plugin.ps1 -BuildArch "${{ matrix.arch }}-bit"
- name: 'Upload build Artifact'
uses: actions/upload-artifact@v4
with:
name: '${{ env.PRODUCT_NAME }}-windows-${{ matrix.arch }}'
path: '${{ github.workspace }}/plugin/*-windows-*.zip'
windows_package:
name: '04 - Windows Installer'
runs-on: [windows-2022]
needs: [get_plugin_info, windows_build]
env:
#CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_SYSTEM_VERSION: "10.0.22000.0"
OBS_VERSION: "${{ needs.get_obs_info.outputs.latest_tag_name }}"
steps:
- name: 'Checkout plugin ${{ needs.get_plugin_info.outputs.git_tag_name }}'
uses: actions/checkout@v4
with:
path: 'plugin'
ref: '${{ needs.get_plugin_info.outputs.git_tag_name }}'
submodules: 'recursive'
- name: 'Download 64-bit artifact'
uses: actions/download-artifact@v4
with:
name: '${{ env.PRODUCT_NAME }}-windows-64'
path: 'plugin'
- name: 'Download 32-bit artifact'
uses: actions/download-artifact@v4
with:
name: '${{ env.PRODUCT_NAME }}-windows-32'
path: 'plugin'
- name: "Install Dependencies"
working-directory: 'plugin'
run: CI/windows/01_install_dependencies.ps1 -BuildArch 64-bit -NoChoco -InstallList "nsis"
- name: 'Build NSIS installer'
working-directory: 'plugin'
run: |
Get-ChildItem -Filter "*-windows-x86.zip" -File | Expand-Archive -Force -DestinationPath ./release/
Get-ChildItem -Filter "*-windows-x64.zip" -File | Expand-Archive -Force -DestinationPath ./release/
CI/windows/04_package_plugin.ps1 -BuildArch 64-bit -BuildInstaller -CombinedArchs
- name: 'Upload build Artifact'
uses: actions/upload-artifact@v4
with:
name: '${{ env.PRODUCT_NAME }}-windows-release'
path: '${{ github.workspace }}/plugin/${{ env.PRODUCT_NAME }}-*-windows-all*.*'
linux_build:
name: '03 - Linux (Ubuntu)'
runs-on: ${{ matrix.ubuntu }}
needs: [get_obs_info, get_plugin_info, clang_check]
strategy:
matrix:
#ubuntu: ['ubuntu-20.04', 'ubuntu-22.04']
ubuntu: ['ubuntu-22.04']
env:
OBS_VERSION: "${{ needs.get_obs_info.outputs.latest_tag_name }}"
defaults:
run:
shell: bash
steps:
- name: 'Checkout plugin ${{ needs.get_plugin_info.outputs.git_tag_name }}'
uses: actions/checkout@v4
with:
path: 'plugin'
ref: '${{ needs.get_plugin_info.outputs.git_tag_name }}'
submodules: 'recursive'
- name: 'Checkout OBS v${{ needs.get_obs_info.outputs.latest_tag_name }}'
uses: actions/checkout@v4
with:
repository: obsproject/obs-studio
path: 'obs-studio'
ref: '${{ needs.get_obs_info.outputs.latest_tag_name }}'
fetch-depth: 0
submodules: 'recursive'
- name: "Install Dependencies"
working-directory: 'plugin'
run: source CI/linux/01_install_dependencies.sh --disable-pipewire
- name: 'Build libobs and obs-frontend-api'
working-directory: 'plugin'
run: source CI/linux/02_build_obs_libs.sh --disable-pipewire
- name: 'Build plugin'
working-directory: 'plugin'
run: source CI/linux/03_build_plugin.sh
- name: 'Create build artifact'
working-directory: 'plugin'
run: source CI/linux/04_package_plugin.sh
- name: 'Upload build Artifact'
uses: actions/upload-artifact@v4
with:
name: '${{ env.PRODUCT_NAME }}-linux-${{ matrix.ubuntu }}'
path: '${{ github.workspace }}/plugin/build/${{ env.PRODUCT_NAME }}-*-linux.*'
macos_build:
name: '03 - macOS (Latest)'
runs-on: [macos-latest]
strategy:
matrix:
arch: ['universal', 'x86_64', 'arm64']
needs: [get_obs_info, get_plugin_info, clang_check]
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
BLOCKED_FORMULAS: 'speexdsp'
OBS_VERSION: "${{ needs.get_obs_info.outputs.latest_tag_name }}"
defaults:
run:
shell: bash
steps:
- name: 'Checkout plugin ${{ needs.get_plugin_info.outputs.git_tag_name }}'
uses: actions/checkout@v4
with:
path: 'plugin'
ref: '${{ needs.get_plugin_info.outputs.git_tag_name }}'
submodules: 'recursive'
- name: 'Checkout OBS v${{ needs.get_obs_info.outputs.latest_tag_name }}'
uses: actions/checkout@v4
with:
repository: obsproject/obs-studio
path: 'obs-studio'
ref: '${{ needs.get_obs_info.outputs.latest_tag_name }}'
fetch-depth: 0
submodules: 'recursive'
- name: 'Setup build environment'
run: |
REMOVE_FORMULAS=""
for FORMULA in ${{ env.BLOCKED_FORMULAS }}; do
if [ -d "/usr/local/opt/${FORMULA}" ]; then
REMOVE_FORMULAS="${REMOVE_FORMULAS}${FORMULA} "
fi
done
if [ -n "${REMOVE_FORMULAS}" ]; then
brew uninstall ${REMOVE_FORMULAS}
fi
- name: 'Install dependencies'
working-directory: 'plugin'
run: source CI/macos/01_install_dependencies.sh --architecture "${{ matrix.arch }}"
- name: 'Build libobs and obs-frontend-api'
working-directory: 'plugin'
run: source CI/macos/02_build_obs_libs.sh --architecture "${{ matrix.arch }}"
- name: 'Build plugin'
working-directory: 'plugin'
run: source CI/macos/03_build_plugin.sh --architecture "${{ matrix.arch }}"
- name: 'Create build artifact'
working-directory: 'plugin'
run: source CI/macos/04_package_plugin.sh --architecture "${{ matrix.arch }}"
- name: 'Upload build Artifact'
uses: actions/upload-artifact@v4
with:
name: '${{ env.PRODUCT_NAME }}-macos-${{ matrix.arch }}'
path: '${{ github.workspace }}/plugin/build/*-macos-${{ matrix.arch }}.*'
create_changelog:
name: '02 - Create Changelog'
runs-on: [ubuntu-latest]
needs: [get_plugin_info]
outputs:
changelog: "${{ steps.create_changelog_text.outputs.body }}\n\n**Full Changelog**: https://github.com/iamscottxu/obs-rtspserver/compare/${{ steps.get_last_release.outputs.tag_name }}...${{ needs.get_plugin_info.outputs.git_tag_name }}"
steps:
- name: 'Checkout plugin ${{ needs.get_plugin_info.outputs.git_tag_name }}'
uses: actions/checkout@v4
with:
ref: '${{ needs.get_plugin_info.outputs.git_tag_name }}'
fetch-depth: 0
- name: 'Get last release info'
id: get_last_release
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
latest: true
- name: 'Create changelog text'
id: create_changelog_text
uses: dlavrenuek/[email protected]
with:
from: "${{ steps.get_last_release.outputs.tag_name }}"
to: "${{ needs.get_plugin_info.outputs.git_tag_name }}"
config-file: "${{ github.workspace }}/.github/workflows/changelogConfig.json"
create_release:
name: '05 - Create release'
runs-on: [ubuntu-latest]
needs: [get_plugin_info, windows_package, linux_build, macos_build, create_changelog]
steps:
- name: 'Check whether the version is prerelease'
uses: MeilCli/regex-match@v1
id: prerelease_test
with:
search_string: ${{ needs.get_plugin_info.outputs.git_tag_name }}
regex_pattern: "^v[1-9][0-9]*.[0-9]+.[0-9]+-[a-z0-9]+$"
- name: 'Create release ${{ needs.get_plugin_info.outputs.git_tag_name }}'
uses: ncipollo/release-action@v1
id: create_release
with:
#bodyFile: "body.md"
body: "${{ needs.create_changelog.outputs.changelog }}"
draft: true
prerelease: ${{ steps.prerelease_test.outputs.matched }}
name: "${{ env.PRODUCT_NAME }} ${{ needs.get_plugin_info.outputs.git_tag_name }}"
token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Download release artifacts'
uses: actions/download-artifact@v4
- name: 'Upload Windows .zip artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-windows-release/${{ env.PRODUCT_NAME }}-${{ needs.get_plugin_info.outputs.git_tag_name }}-windows-all.zip
asset_name: ${{ env.PRODUCT_NAME }}-${{ needs.get_plugin_info.outputs.git_tag_name }}-windows.zip
asset_content_type: application/zip
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload Windows .exe artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-windows-release/${{ env.PRODUCT_NAME }}-${{ needs.get_plugin_info.outputs.git_tag_name }}-windows-all-installer.exe
asset_name: ${{ env.PRODUCT_NAME }}-${{ needs.get_plugin_info.outputs.git_tag_name }}-windows-installer.exe
asset_content_type: application/x-msdownload
github_token: ${{ secrets.GITHUB_TOKEN }}
#- name: 'Upload linux qt5 .tar.gz artifact to release'
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-linux-ubuntu-20.04/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux.tar.gz
# asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux-qt5.tar.gz
# asset_content_type: application/x-gzip
# github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload linux qt6 .tar.gz artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-linux-ubuntu-22.04/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux.tar.gz
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux-qt6.tar.gz
asset_content_type: application/x-gzip
github_token: ${{ secrets.GITHUB_TOKEN }}
# - name: 'Upload linux qt5 .deb artifact to release'
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-linux-ubuntu-20.04/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux.deb
# asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux-qt5.deb
# asset_content_type: application/vnd.debian.binary-package
# github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload linux qt6 .deb artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-linux-ubuntu-22.04/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux.deb
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux-qt6.deb
asset_content_type: application/vnd.debian.binary-package
github_token: ${{ secrets.GITHUB_TOKEN }}
# - name: 'Upload linux qt5 .rpm artifact to release'
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-linux-ubuntu-20.04/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux.rpm
# asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux-qt5.rpm
# asset_content_type: application/vnd.debian.binary-package
# github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload linux qt6 .rpm artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-linux-ubuntu-22.04/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux.rpm
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-linux-qt6.rpm
asset_content_type: application/vnd.debian.binary-package
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload macos universal .zip artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-macos-universal/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-universal.zip
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-universal.zip
asset_content_type: application/zip
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload macos universal .pkg artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-macos-universal/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-universal.pkg
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-universal.pkg
asset_content_type: application/vnd.apple.installer+xml
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload macos x86_64 .zip artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-macos-x86_64/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-x86_64.zip
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-x86_64.zip
asset_content_type: application/zip
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload macos x86_64 .pkg artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-macos-x86_64/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-x86_64.pkg
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-x86_64.pkg
asset_content_type: application/vnd.apple.installer+xml
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload macos arm64 .zip artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-macos-arm64/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-arm64.zip
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-arm64.zip
asset_content_type: application/zip
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload macos arm64 .pkg artifact to release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PRODUCT_NAME }}-macos-arm64/obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-arm64.pkg
asset_name: obs-rtspserver-${{ needs.get_plugin_info.outputs.git_tag_name }}-macos-arm64.pkg
asset_content_type: application/vnd.apple.installer+xml
github_token: ${{ secrets.GITHUB_TOKEN }}