2022-03-16 15:13:26 -07:00
|
|
|
name: 'BUILD'
|
2020-04-09 02:34:29 -07:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-03-16 15:13:26 -07:00
|
|
|
paths-ignore: ['**.md']
|
2020-07-06 11:38:13 -07:00
|
|
|
branches:
|
|
|
|
- master
|
2022-01-01 18:19:36 -08:00
|
|
|
- 'release/**'
|
2022-03-16 15:13:26 -07:00
|
|
|
tags: ['*']
|
2020-04-09 02:34:29 -07:00
|
|
|
pull_request:
|
2022-03-16 15:13:26 -07:00
|
|
|
paths-ignore: ['**.md']
|
|
|
|
branches: [master]
|
2020-04-09 02:34:29 -07:00
|
|
|
|
|
|
|
env:
|
2022-08-23 02:47:41 -07:00
|
|
|
CACHE_REVISION: '006'
|
2022-07-29 22:57:31 -07:00
|
|
|
CEF_BUILD_VERSION_MAC: '5060'
|
|
|
|
CEF_HASH_MAC_X86_64: '88b950aa0bfc001061c35e7f1f3fefba856a6afb35e38b2b7b42ddd8dd239182'
|
|
|
|
CEF_HASH_MAC_ARM64: '98679b92eea6ea9959ac5aa54f46ca60681d8a86c768c35f496dbdd409bf0642'
|
|
|
|
CEF_BUILD_VERSION_LINUX: '5060'
|
|
|
|
CEF_BUILD_VERSION_WIN: '5060'
|
2022-07-31 09:20:13 -07:00
|
|
|
QT_VERSION_MAC: '6.3.1'
|
2022-08-01 19:39:09 -07:00
|
|
|
QT_HASH_MAC_X86_64: 'a83f72a11023b03b6cb2dc365f0a66ad9df31163bbb4fe2df32d601856a9fad3'
|
|
|
|
QT_HASH_MAC_ARM64: '2f30af90c049670a5660656adbb440668aa1b0567f75a5f29e1def9108928403'
|
|
|
|
QT_HASH_MAC_UNIVERSAL: '252e6684f43ab9c6f262c73af739e2296ce391b998da2c4ee04c254aaa07db18'
|
2022-07-31 09:20:13 -07:00
|
|
|
QT_VERSION_WIN: '6.3.1'
|
2022-08-01 19:39:09 -07:00
|
|
|
DEPS_VERSION_MAC: '2022-08-02'
|
|
|
|
DEPS_HASH_MAC_X86_64: '7637e52305e6fc53014b5aabd583f1a4490b1d97450420e977cae9a336a29525'
|
|
|
|
DEPS_HASH_MAC_ARM64: '755e0fa69b17a3ae444e1befa9d91d77e3cafe628fbd1c6333686091826595cd'
|
|
|
|
DEPS_VERSION_WIN: '2022-08-02'
|
2022-03-16 15:13:26 -07:00
|
|
|
VLC_VERSION_MAC: '3.0.8'
|
2022-03-16 15:15:53 -07:00
|
|
|
VLC_HASH_MAC: 'e0149ef4a20a19b9ecd87309c2d27787ee3f47dfd47c6639644bc1f6fd95bdf6'
|
2022-03-16 15:13:26 -07:00
|
|
|
VLC_VERSION_WIN: '3.0.0-git'
|
2021-01-26 16:39:09 -08:00
|
|
|
TWITCH_CLIENTID: ${{ secrets.TWITCH_CLIENT_ID }}
|
|
|
|
TWITCH_HASH: ${{ secrets.TWITCH_HASH }}
|
|
|
|
RESTREAM_CLIENTID: ${{ secrets.RESTREAM_CLIENTID }}
|
|
|
|
RESTREAM_HASH: ${{ secrets.RESTREAM_HASH }}
|
2021-06-27 15:30:00 -07:00
|
|
|
YOUTUBE_CLIENTID: ${{ secrets.YOUTUBE_CLIENTID }}
|
|
|
|
YOUTUBE_CLIENTID_HASH: ${{ secrets.YOUTUBE_CLIENTID_HASH }}
|
|
|
|
YOUTUBE_SECRET: ${{ secrets.YOUTUBE_SECRET }}
|
|
|
|
YOUTUBE_SECRET_HASH: ${{ secrets.YOUTUBE_SECRET_HASH }}
|
2020-04-09 02:34:29 -07:00
|
|
|
|
|
|
|
jobs:
|
2022-03-16 15:13:26 -07:00
|
|
|
clang_check:
|
|
|
|
name: '01 - Code Format Check'
|
2022-07-27 07:45:26 -07:00
|
|
|
runs-on: [ubuntu-22.04]
|
2022-03-16 15:13:26 -07:00
|
|
|
steps:
|
|
|
|
- name: 'Checkout'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/checkout@v3
|
2022-03-16 15:13:26 -07:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
|
|
|
|
|
|
|
- name: 'Install clang-format'
|
2022-07-27 07:45:26 -07:00
|
|
|
run: sudo apt-get install -y clang-format-13
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Run clang-format'
|
|
|
|
run: |
|
|
|
|
./CI/check-format.sh
|
|
|
|
./CI/check-changes.sh
|
|
|
|
|
|
|
|
- name: 'Install cmake-format'
|
|
|
|
run: sudo pip install cmakelang
|
|
|
|
|
|
|
|
- name: 'Run cmake-format'
|
|
|
|
run: |
|
|
|
|
./CI/check-cmake.sh
|
|
|
|
|
|
|
|
macos_build:
|
|
|
|
name: '02 - macOS'
|
2022-04-28 14:01:17 -07:00
|
|
|
runs-on: [macos-12]
|
2022-03-16 15:13:26 -07:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-16 15:15:53 -07:00
|
|
|
arch: ['x86_64', 'arm64']
|
2022-03-16 15:13:26 -07:00
|
|
|
if: always()
|
|
|
|
needs: [clang_check]
|
2020-04-09 02:34:29 -07:00
|
|
|
env:
|
2022-07-28 09:52:14 -07:00
|
|
|
MACOSX_DEPLOYMENT_TARGET_X86_64: '10.15'
|
2022-03-16 15:15:53 -07:00
|
|
|
MACOSX_DEPLOYMENT_TARGET_ARM64: '11.0'
|
2022-03-16 15:13:26 -07:00
|
|
|
SPARKLE_VERSION: '1.26.0'
|
|
|
|
SPARKLE_HASH: '8312cbf7528297a49f1b97692c33cb8d33254c396dc51be394e9484e4b6833a0'
|
|
|
|
BLOCKED_FORMULAS: 'speexdsp curl php composer'
|
|
|
|
CODESIGN_IDENT: '-'
|
2021-05-18 13:05:19 -07:00
|
|
|
HAVE_CODESIGN_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY != '' && secrets.MACOS_SIGNING_CERT != '' }}
|
2022-03-16 15:13:26 -07:00
|
|
|
defaults:
|
|
|
|
run:
|
2021-04-11 17:57:33 -07:00
|
|
|
shell: bash
|
2022-03-16 15:13:26 -07:00
|
|
|
working-directory: 'obs-studio'
|
|
|
|
steps:
|
2020-04-09 02:34:29 -07:00
|
|
|
- name: 'Checkout'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/checkout@v3
|
2020-04-09 02:34:29 -07:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2022-03-16 15:13:26 -07:00
|
|
|
path: 'obs-studio'
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2020-07-06 11:38:13 -07:00
|
|
|
- name: 'Check for Github Labels'
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: |
|
2022-03-16 15:13:26 -07:00
|
|
|
if test -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')"; then
|
2020-10-06 09:35:44 -07:00
|
|
|
echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
|
2020-07-06 11:38:13 -07:00
|
|
|
else
|
2020-10-06 09:35:44 -07:00
|
|
|
echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
|
2020-07-06 11:38:13 -07:00
|
|
|
fi
|
2020-10-23 13:55:08 -07:00
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
echo "CACHE_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: 'Restore ccache from cache'
|
|
|
|
id: ccache-cache
|
2022-05-19 14:12:47 -07:00
|
|
|
uses: actions/cache@v3
|
2022-03-16 15:13:26 -07:00
|
|
|
env:
|
|
|
|
CACHE_NAME: 'ccache-cache'
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/.ccache
|
|
|
|
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ matrix.arch }}-${{ env.CACHE_DATE }}
|
2020-12-20 07:56:31 -08:00
|
|
|
|
2020-05-06 08:28:02 -07:00
|
|
|
- name: 'Restore Chromium Embedded Framework from cache'
|
|
|
|
id: cef-cache
|
2022-05-19 14:12:47 -07:00
|
|
|
uses: actions/cache@v3
|
2020-05-06 08:28:02 -07:00
|
|
|
env:
|
|
|
|
CACHE_NAME: 'cef-cache'
|
|
|
|
with:
|
2022-03-16 15:13:26 -07:00
|
|
|
path: ${{ github.workspace }}/obs-build-dependencies/cef_binary_${{ env.CEF_BUILD_VERSION_MAC }}_macos_${{ matrix.arch }}
|
2022-03-16 15:15:53 -07:00
|
|
|
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_BUILD_VERSION_MAC }}-${{ matrix.arch }}-${{ env.CACHE_REVISION }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
2020-05-06 08:28:02 -07:00
|
|
|
- name: 'Restore VLC dependency from cache'
|
|
|
|
id: vlc-cache
|
2022-05-19 14:12:47 -07:00
|
|
|
uses: actions/cache@v3
|
2020-05-06 08:28:02 -07:00
|
|
|
env:
|
|
|
|
CACHE_NAME: 'vlc-cache'
|
|
|
|
with:
|
2022-03-16 15:13:26 -07:00
|
|
|
path: ${{ github.workspace }}/obs-build-dependencies/vlc-${{ env.VLC_VERSION_MAC }}
|
2022-03-16 15:15:53 -07:00
|
|
|
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION_MAC }}-${{ env.CACHE_REVISION }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
2020-05-06 08:28:02 -07:00
|
|
|
- name: 'Restore Sparkle dependency from cache'
|
|
|
|
id: sparkle-cache
|
2022-05-19 14:12:47 -07:00
|
|
|
uses: actions/cache@v3
|
2020-05-06 08:28:02 -07:00
|
|
|
env:
|
|
|
|
CACHE_NAME: 'sparkle-cache'
|
|
|
|
with:
|
2022-03-16 15:15:53 -07:00
|
|
|
path: ${{ github.workspace }}/obs-build-dependencies/obs-deps/lib/Sparkle.framework
|
|
|
|
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.SPARKLE_VERSION }}-${{ env.CACHE_REVISION }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Setup build environment'
|
2022-03-24 10:35:03 -07:00
|
|
|
id: setup
|
2022-03-16 15:13:26 -07:00
|
|
|
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
|
|
|
|
|
2022-04-12 10:49:38 -07:00
|
|
|
echo "::set-output name=commitHash::$(git rev-parse --short=9 HEAD)"
|
2022-03-24 10:35:03 -07:00
|
|
|
|
2022-08-10 17:46:09 -07:00
|
|
|
- name: 'Switch to Xcode 14 Beta'
|
|
|
|
run: sudo xcode-select -switch /Applications/Xcode_14.0.app
|
2022-08-02 15:57:38 -07:00
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Install dependencies'
|
|
|
|
env:
|
|
|
|
RESTORED_VLC: ${{ steps.vlc-cache.outputs.cache-hit }}
|
|
|
|
RESTORED_SPARKLE: ${{ steps.sparkle-cache.outputs.cache-hit }}
|
|
|
|
RESTORED_CEF: ${{ steps.cef-cache.outputs.cache-hit }}
|
|
|
|
run: CI/macos/01_install_dependencies.sh --architecture "${{ matrix.arch }}"
|
|
|
|
|
2020-09-10 12:13:56 -07:00
|
|
|
- name: 'Install Apple Developer Certificate'
|
2022-03-16 15:13:26 -07:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && env.HAVE_CODESIGN_IDENTITY == 'true' }}
|
2020-09-10 12:13:56 -07:00
|
|
|
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
|
|
|
|
with:
|
|
|
|
p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
|
|
|
|
p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
2020-09-10 12:13:56 -07:00
|
|
|
- name: 'Set Signing Identity'
|
2022-03-16 15:13:26 -07:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && env.HAVE_CODESIGN_IDENTITY == 'true' }}
|
2020-09-10 12:13:56 -07:00
|
|
|
run: |
|
2022-03-16 15:13:26 -07:00
|
|
|
echo "CODESIGN_IDENT=${{ secrets.MACOS_SIGNING_IDENTITY }}" >> $GITHUB_ENV
|
|
|
|
echo "BUILD_FOR_DISTRIBUTION=ON" >> $GITHUB_ENV
|
2020-09-10 12:13:56 -07:00
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Build OBS'
|
|
|
|
run: CI/macos/02_build_obs.sh --codesign --architecture "${{ matrix.arch }}"
|
2021-02-25 07:32:07 -08:00
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Run tests'
|
2022-03-16 15:15:53 -07:00
|
|
|
if: ${{ success() && matrix.arch == 'x86_64' }}
|
2022-03-16 15:13:26 -07:00
|
|
|
run: cmake --build build -t test
|
2021-02-25 07:32:07 -08:00
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Create build artifact'
|
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
2020-09-09 15:45:43 -07:00
|
|
|
run: |
|
2022-03-16 15:15:53 -07:00
|
|
|
CI/macos/03_package_obs.sh --codesign --architecture "${{ matrix.arch }}"
|
2022-03-16 15:13:26 -07:00
|
|
|
ARTIFACT_NAME=$(basename $(/usr/bin/find build -type f -name "obs-studio-*.dmg" -depth 1 | head -1))
|
|
|
|
echo "FILE_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
|
2020-09-09 15:45:43 -07:00
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Upload build Artifact'
|
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-09-09 15:45:43 -07:00
|
|
|
with:
|
2022-03-28 19:46:38 -07:00
|
|
|
name: 'obs-studio-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
|
2022-03-16 15:13:26 -07:00
|
|
|
path: '${{ github.workspace }}/obs-studio/build/${{ env.FILE_NAME }}'
|
|
|
|
|
|
|
|
linux_build:
|
|
|
|
name: '02 - Linux'
|
|
|
|
runs-on: ${{ matrix.ubuntu }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-11 10:45:58 -07:00
|
|
|
ubuntu: ['ubuntu-20.04', 'ubuntu-22.04']
|
2022-03-16 15:13:26 -07:00
|
|
|
if: always()
|
|
|
|
needs: [clang_check]
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
working-directory: 'obs-studio'
|
|
|
|
env:
|
|
|
|
BUILD_FOR_DISTRIBUTION: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
|
2020-04-09 02:34:29 -07:00
|
|
|
steps:
|
|
|
|
- name: 'Checkout'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/checkout@v3
|
2020-04-09 02:34:29 -07:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2022-03-16 15:13:26 -07:00
|
|
|
path: 'obs-studio'
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2020-07-06 11:38:13 -07:00
|
|
|
- name: 'Check for Github Labels'
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: |
|
2022-03-16 15:13:26 -07:00
|
|
|
if test -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')"; then
|
2020-10-06 09:35:44 -07:00
|
|
|
echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
|
2020-07-06 11:38:13 -07:00
|
|
|
else
|
2020-10-06 09:35:44 -07:00
|
|
|
echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
|
2020-07-06 11:38:13 -07:00
|
|
|
fi
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
echo "CACHE_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: 'Restore ccache from cache'
|
|
|
|
id: ccache-cache
|
2022-05-19 14:12:47 -07:00
|
|
|
uses: actions/cache@v3
|
2022-03-16 15:13:26 -07:00
|
|
|
env:
|
|
|
|
CACHE_NAME: 'ccache-cache'
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/.ccache
|
|
|
|
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ matrix.ubuntu }}-${{ env.CACHE_DATE }}
|
|
|
|
|
2020-05-06 08:28:02 -07:00
|
|
|
- name: 'Restore Chromium Embedded Framework from cache'
|
|
|
|
id: cef-cache
|
2022-05-19 14:12:47 -07:00
|
|
|
uses: actions/cache@v3
|
2020-05-06 08:28:02 -07:00
|
|
|
env:
|
|
|
|
CACHE_NAME: 'cef-cache'
|
|
|
|
with:
|
2022-03-16 15:13:26 -07:00
|
|
|
path: ${{ github.workspace }}/obs-build-dependencies/cef_binary_${{ env.CEF_BUILD_VERSION_LINUX }}_linux64
|
2022-03-16 15:15:53 -07:00
|
|
|
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_BUILD_VERSION_LINUX }}-${{ env.CACHE_REVISION }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
2022-03-24 10:35:03 -07:00
|
|
|
- name: 'Setup build environment'
|
|
|
|
id: setup
|
|
|
|
run: |
|
2022-04-12 10:49:38 -07:00
|
|
|
echo "::set-output name=commitHash::$(git rev-parse --short=9 HEAD)"
|
2022-03-24 10:35:03 -07:00
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Install dependencies'
|
|
|
|
env:
|
|
|
|
RESTORED_CEF: ${{ steps.cef-cache.outputs.cache-hit }}
|
|
|
|
run: CI/linux/01_install_dependencies.sh --disable-pipewire
|
|
|
|
|
|
|
|
- name: 'Build OBS'
|
|
|
|
run: CI/linux/02_build_obs.sh --disable-pipewire
|
|
|
|
|
|
|
|
- name: 'Run tests'
|
|
|
|
if: success()
|
|
|
|
run: cmake --build build -t test
|
|
|
|
|
|
|
|
- name: 'Create build artifact'
|
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
2020-04-09 02:34:29 -07:00
|
|
|
run: |
|
2022-03-16 15:13:26 -07:00
|
|
|
CI/linux/03_package_obs.sh
|
|
|
|
ARTIFACT_NAME=$(basename $(/usr/bin/find build -maxdepth 1 -type f -name "obs-studio-*.deb" | sort -rn | head -1))
|
|
|
|
echo "FILE_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: 'Upload build Artifact'
|
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-04-09 02:34:29 -07:00
|
|
|
with:
|
2022-03-28 19:46:38 -07:00
|
|
|
name: 'obs-studio-${{ matrix.ubuntu }}-${{ steps.setup.outputs.commitHash }}'
|
2022-03-16 15:13:26 -07:00
|
|
|
path: '${{ github.workspace }}/obs-studio/build/${{ env.FILE_NAME }}'
|
|
|
|
|
|
|
|
windows_build:
|
|
|
|
name: '02 - Windows'
|
2022-07-27 07:45:26 -07:00
|
|
|
runs-on: [windows-2022]
|
2022-03-16 15:13:26 -07:00
|
|
|
needs: [clang_check]
|
|
|
|
if: always()
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-28 07:29:06 -07:00
|
|
|
arch: [x64, x86]
|
2020-04-09 02:34:29 -07:00
|
|
|
env:
|
2022-07-27 07:45:26 -07:00
|
|
|
CMAKE_GENERATOR: 'Visual Studio 17 2022'
|
2022-03-16 15:13:26 -07:00
|
|
|
CMAKE_SYSTEM_VERSION: '10.0.18363.657'
|
|
|
|
VIRTUALCAM-GUID: 'A3FCE0F5-3493-419F-958A-ABA1250EC20B'
|
|
|
|
BUILD_FOR_DISTRIBUTION: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: 'obs-studio'
|
2020-04-09 02:34:29 -07:00
|
|
|
steps:
|
|
|
|
- name: 'Checkout'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/checkout@v3
|
2020-04-09 02:34:29 -07:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2022-03-16 15:13:26 -07:00
|
|
|
path: 'obs-studio'
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: 'Add msbuild to PATH'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: microsoft/setup-msbuild@v1.1
|
2022-03-16 15:13:26 -07:00
|
|
|
|
2020-07-06 11:38:13 -07:00
|
|
|
- name: 'Check for Github Labels'
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: |
|
2022-03-16 15:13:26 -07:00
|
|
|
$LabelFound = try { (Invoke-RestMethod -Authentication 'Bearer' -Token (ConvertTo-SecureString '${{ secrets.GITHUB_TOKEN }}' -AsPlainText) -Uri "${{ github.event.pull_request.url }}" -UseBasicParsing).labels.name.contains("Seeking Testers") } catch { $false }
|
|
|
|
Write-Output "SEEKING_TESTERS=$(if( $LabelFound -eq $true ) { 1 } else { 0 })" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
|
2020-05-06 08:28:02 -07:00
|
|
|
- name: 'Restore VLC dependency from cache'
|
|
|
|
id: vlc-cache
|
2022-05-19 14:12:47 -07:00
|
|
|
uses: actions/cache@v3
|
2020-05-06 08:28:02 -07:00
|
|
|
env:
|
2022-03-16 15:13:26 -07:00
|
|
|
CACHE_NAME: 'vlc-cache'
|
2020-05-06 08:28:02 -07:00
|
|
|
with:
|
2022-03-16 15:13:26 -07:00
|
|
|
path: ${{ github.workspace }}/obs-build-dependencies/vlc-${{ env.VLC_VERSION_WIN }}
|
2022-03-16 15:15:53 -07:00
|
|
|
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION_WIN }}-${{ env.CACHE_REVISION }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Restore Chromium Embedded Framework from cache'
|
2020-05-06 08:28:02 -07:00
|
|
|
id: cef-cache
|
2022-05-19 14:12:47 -07:00
|
|
|
uses: actions/cache@v3
|
2020-05-06 08:28:02 -07:00
|
|
|
env:
|
2022-03-16 15:13:26 -07:00
|
|
|
CACHE_NAME: 'cef-cache'
|
2020-05-06 08:28:02 -07:00
|
|
|
with:
|
2022-03-28 07:29:06 -07:00
|
|
|
path: ${{ github.workspace }}/obs-build-dependencies/cef_binary_${{ env.CEF_BUILD_VERSION_WIN }}_windows_${{ matrix.arch }}
|
|
|
|
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_BUILD_VERSION_WIN }}-${{ matrix.arch }}-${{ env.CACHE_REVISION }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
2022-03-24 10:35:03 -07:00
|
|
|
- name: Setup Environment
|
|
|
|
id: setup
|
|
|
|
run: |
|
2022-04-12 10:49:38 -07:00
|
|
|
$CommitHash = git rev-parse --short=9 HEAD
|
2022-03-24 10:35:03 -07:00
|
|
|
Write-Output "::set-output name=commitHash::${CommitHash}"
|
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Install dependencies'
|
|
|
|
env:
|
|
|
|
RESTORED_VLC: ${{ steps.vlc-cache.outputs.cache-hit }}
|
|
|
|
RESTORED_CEF: ${{ steps.cef-cache.outputs.cache-hit }}
|
2022-03-28 07:29:06 -07:00
|
|
|
run: CI/windows/01_install_dependencies.ps1 -BuildArch ${{ matrix.arch }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Build OBS'
|
2022-03-28 07:29:06 -07:00
|
|
|
run: CI/windows/02_build_obs.ps1 -BuildArch ${{ matrix.arch }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Create build artifact'
|
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
2020-04-09 02:34:29 -07:00
|
|
|
run: |
|
2022-03-28 07:29:06 -07:00
|
|
|
CI/windows/03_package_obs.ps1 -BuildArch ${{ matrix.arch }} -Package
|
2022-03-28 19:46:38 -07:00
|
|
|
$ArtifactName = Get-ChildItem -filter "obs-studio-*-windows-${{ matrix.arch }}.zip" -File
|
2022-03-16 15:13:26 -07:00
|
|
|
Write-Output "FILE_NAME=${ArtifactName}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
|
|
|
|
- name: 'Upload build artifact'
|
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-04-09 02:34:29 -07:00
|
|
|
with:
|
2022-03-28 19:46:38 -07:00
|
|
|
name: 'obs-studio-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
|
2022-03-16 15:13:26 -07:00
|
|
|
path: '${{ env.FILE_NAME }}'
|
|
|
|
|
|
|
|
linux_package:
|
|
|
|
name: '02 - Flatpak Bundle'
|
|
|
|
runs-on: [ubuntu-latest]
|
|
|
|
needs: [clang_check]
|
|
|
|
if: always()
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
container:
|
2022-08-16 08:04:25 -07:00
|
|
|
image: bilelmoussaoui/flatpak-github-actions:kde-6.3
|
2022-03-16 15:13:26 -07:00
|
|
|
options: --privileged
|
2020-04-09 02:34:29 -07:00
|
|
|
steps:
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Check for Github Labels'
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: |
|
|
|
|
if ! /usr/bin/command -v "jq" >/dev/null 2>&1; then sudo dnf install -y -q jq; fi
|
|
|
|
if test -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')"; then
|
|
|
|
echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
|
|
|
|
fi
|
|
|
|
|
2020-04-09 02:34:29 -07:00
|
|
|
- name: 'Checkout'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/checkout@v3
|
2022-03-16 15:13:26 -07:00
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
2020-04-09 02:34:29 -07:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2022-03-16 15:13:26 -07:00
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: 'Setup build environment'
|
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
2020-04-09 02:34:29 -07:00
|
|
|
run: |
|
2022-06-26 00:22:22 -07:00
|
|
|
git config --global --add safe.directory $GITHUB_WORKSPACE
|
2020-10-06 09:35:44 -07:00
|
|
|
echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
|
2022-04-12 10:49:38 -07:00
|
|
|
echo "OBS_GIT_HASH=$(git rev-parse --short=9 HEAD)" >> $GITHUB_ENV
|
2020-10-06 09:35:44 -07:00
|
|
|
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: Build Flatpak Manifest
|
|
|
|
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
|
|
|
|
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
|
|
|
|
with:
|
2022-04-12 10:49:38 -07:00
|
|
|
bundle: obs-studio-flatpak-${{ env.OBS_GIT_HASH }}.flatpak
|
2022-03-16 15:13:26 -07:00
|
|
|
manifest-path: CI/flatpak/com.obsproject.Studio.json
|
2021-08-16 01:38:28 -07:00
|
|
|
cache-key: flatpak-builder-${{ hashFiles('CI/flatpak/com.obsproject.Studio.json') }}
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
windows_package:
|
|
|
|
name: '03 - Windows Installer'
|
|
|
|
runs-on: [windows-latest]
|
|
|
|
needs: [windows_build]
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
|
|
|
|
env:
|
|
|
|
BUILD_FOR_DISTRIBUTION: 'ON'
|
|
|
|
steps:
|
|
|
|
- name: 'Checkout'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/checkout@v3
|
2022-03-16 15:13:26 -07:00
|
|
|
|
2022-04-12 10:49:38 -07:00
|
|
|
- name: Setup Environment
|
|
|
|
id: setup
|
|
|
|
run: |
|
|
|
|
$CommitHash = git rev-parse --short=9 HEAD
|
|
|
|
Write-Output "::set-output name=commitHash::${CommitHash}"
|
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Add msbuild to PATH'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: microsoft/setup-msbuild@v1.1
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Download 64-bit artifact'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/download-artifact@v3
|
2022-03-16 15:13:26 -07:00
|
|
|
with:
|
2022-03-28 19:46:38 -07:00
|
|
|
name: 'obs-studio-windows-x64-${{ steps.setup.outputs.commitHash }}'
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Download 32-bit artifact'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/download-artifact@v3
|
2022-03-16 15:13:26 -07:00
|
|
|
with:
|
2022-03-28 19:46:38 -07:00
|
|
|
name: 'obs-studio-windows-x86-${{ steps.setup.outputs.commitHash }}'
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Unpack Windows build artifacts'
|
2022-04-12 10:49:38 -07:00
|
|
|
id: unpack
|
2020-07-06 11:38:13 -07:00
|
|
|
run: |
|
2022-03-16 15:13:26 -07:00
|
|
|
if (!(Test-Path install_temp)) {
|
|
|
|
$null = New-Item -ItemType Directory -Force -Path install_temp
|
|
|
|
}
|
|
|
|
|
2022-08-01 18:07:14 -07:00
|
|
|
Expand-Archive -Path "$(Get-ChildItem -filter "obs-studio-*-windows-x86.zip" -File)" -DestinationPath install_temp
|
|
|
|
Expand-Archive -Path "$(Get-ChildItem -filter "obs-studio-*-windows-x64.zip" -File)" -Force -DestinationPath install_temp
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
CI/windows/03_package_obs.ps1 -CombinedArchs -Package
|
|
|
|
|
2022-03-28 19:46:38 -07:00
|
|
|
$ArtifactName = (Get-ChildItem -filter "obs-studio-*-windows-x86+x64.zip" -File).Name
|
2022-04-12 10:49:38 -07:00
|
|
|
Write-Output "::set-output name=filename::${ArtifactName}"
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Upload build artifact'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-05-06 08:28:02 -07:00
|
|
|
with:
|
2022-03-28 19:46:38 -07:00
|
|
|
name: 'obs-studio-windows-installer'
|
2022-04-12 10:49:38 -07:00
|
|
|
path: '${{ steps.unpack.outputs.filename }}'
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
macos_release:
|
|
|
|
name: '03 - macOS notarized image'
|
2022-04-28 14:01:17 -07:00
|
|
|
runs-on: [macos-12]
|
2022-03-16 15:13:26 -07:00
|
|
|
needs: [macos_build]
|
|
|
|
env:
|
|
|
|
HAVE_CODESIGN_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY != '' && secrets.MACOS_SIGNING_CERT != '' }}
|
|
|
|
BUILD_FOR_DISTRIBUTION: 'ON'
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-16 15:15:53 -07:00
|
|
|
arch: ['x86_64', 'arm64']
|
2022-03-16 15:13:26 -07:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
steps:
|
|
|
|
- name: 'Checkout'
|
|
|
|
if: env.HAVE_CODESIGN_IDENTITY == 'true'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/checkout@v3
|
2022-03-16 15:13:26 -07:00
|
|
|
|
2022-04-12 10:49:38 -07:00
|
|
|
- name: 'Setup build environment'
|
|
|
|
id: setup
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=commitHash::$(git rev-parse --short=9 HEAD)"
|
|
|
|
|
2022-03-16 15:13:26 -07:00
|
|
|
- name: 'Download artifact'
|
|
|
|
if: env.HAVE_CODESIGN_IDENTITY == 'true'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/download-artifact@v3
|
2020-05-06 08:28:02 -07:00
|
|
|
with:
|
2022-03-28 19:46:38 -07:00
|
|
|
name: 'obs-studio-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
|
2022-03-16 15:13:26 -07:00
|
|
|
|
|
|
|
- name: 'Install Apple Developer Certificate'
|
|
|
|
if: env.HAVE_CODESIGN_IDENTITY == 'true'
|
|
|
|
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
|
2020-05-06 08:28:02 -07:00
|
|
|
with:
|
2022-03-16 15:13:26 -07:00
|
|
|
p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
|
|
|
|
p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
|
|
|
|
|
|
|
|
- name: 'Create disk image for distribution'
|
|
|
|
if: env.HAVE_CODESIGN_IDENTITY == 'true'
|
2020-05-06 08:28:02 -07:00
|
|
|
env:
|
2022-03-16 15:13:26 -07:00
|
|
|
CODESIGN_IDENT: ${{ secrets.MACOS_SIGNING_IDENTITY }}
|
|
|
|
CODESIGN_IDENT_USER: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
|
|
|
|
CODESIGN_IDENT_PASS: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
|
2020-04-09 02:34:29 -07:00
|
|
|
run: |
|
2022-03-16 15:13:26 -07:00
|
|
|
ARTIFACT_NAME=$(/usr/bin/find . -type f -name "obs-studio-*.dmg" -depth 1 | head -1)
|
|
|
|
CI/macos/03_package_obs.sh --notarize-image ${ARTIFACT_NAME}
|
|
|
|
|
|
|
|
echo "FILE_NAME=$(basename ${ARTIFACT_NAME})" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: 'Upload build Artifact'
|
|
|
|
if: env.HAVE_CODESIGN_IDENTITY == 'true'
|
2022-03-21 10:20:54 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-04-09 02:34:29 -07:00
|
|
|
with:
|
2022-03-28 19:46:38 -07:00
|
|
|
name: 'obs-studio-macos-${{ matrix.arch }}-notarized'
|
2022-03-16 15:13:26 -07:00
|
|
|
path: '${{ github.workspace }}/${{ env.FILE_NAME }}'
|