main.yml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. name: 'BUILD'
  2. on:
  3. push:
  4. paths-ignore: ['**.md']
  5. branches:
  6. - master
  7. - 'release/**'
  8. tags: ['*']
  9. pull_request:
  10. paths-ignore: ['**.md']
  11. branches: [master]
  12. env:
  13. CACHE_REVISION: '006'
  14. CEF_BUILD_VERSION_MAC: '5060'
  15. CEF_HASH_MAC_X86_64: '88b950aa0bfc001061c35e7f1f3fefba856a6afb35e38b2b7b42ddd8dd239182'
  16. CEF_HASH_MAC_ARM64: '98679b92eea6ea9959ac5aa54f46ca60681d8a86c768c35f496dbdd409bf0642'
  17. CEF_BUILD_VERSION_LINUX: '5060'
  18. CEF_BUILD_VERSION_WIN: '5060'
  19. QT_VERSION_MAC: '6.4.1'
  20. QT_HASH_MAC_X86_64: 'c5ed7bc9f6e802910ec539066bcf0a8d64100fafce568071f264c88c22c5859b'
  21. QT_HASH_MAC_ARM64: '1ce472fd1e28f947456b72b1d7ab929d6e93cb774c2928e22eca9bb751b12ccf'
  22. QT_HASH_MAC_UNIVERSAL: '873f7c9c9f7fcee740a79c075b32a505c932c816d928807fa16f3439c610fbfd'
  23. QT_VERSION_WIN: '6.4.1'
  24. DEPS_VERSION_MAC: '2022-11-21'
  25. DEPS_HASH_MAC_X86_64: 'ed0a145e88496f8975da14a07939dbe5633e60510aada34509a4aef64a66e438'
  26. DEPS_HASH_MAC_ARM64: 'f397dc524e5ee7f85684f0b9661c45957446e28d166fcd6dfacf895c9d4d2521'
  27. DEPS_VERSION_WIN: '2022-11-21'
  28. VLC_VERSION_MAC: '3.0.8'
  29. VLC_HASH_MAC: 'e0149ef4a20a19b9ecd87309c2d27787ee3f47dfd47c6639644bc1f6fd95bdf6'
  30. VLC_VERSION_WIN: '3.0.0-git'
  31. TWITCH_CLIENTID: ${{ secrets.TWITCH_CLIENT_ID }}
  32. TWITCH_HASH: ${{ secrets.TWITCH_HASH }}
  33. RESTREAM_CLIENTID: ${{ secrets.RESTREAM_CLIENTID }}
  34. RESTREAM_HASH: ${{ secrets.RESTREAM_HASH }}
  35. YOUTUBE_CLIENTID: ${{ secrets.YOUTUBE_CLIENTID }}
  36. YOUTUBE_CLIENTID_HASH: ${{ secrets.YOUTUBE_CLIENTID_HASH }}
  37. YOUTUBE_SECRET: ${{ secrets.YOUTUBE_SECRET }}
  38. YOUTUBE_SECRET_HASH: ${{ secrets.YOUTUBE_SECRET_HASH }}
  39. jobs:
  40. clang_check:
  41. name: '01 - Code Format Check'
  42. runs-on: [ubuntu-22.04]
  43. steps:
  44. - name: 'Checkout'
  45. uses: actions/checkout@v3
  46. with:
  47. submodules: 'recursive'
  48. - name: 'Install clang-format'
  49. run: sudo apt-get install -y clang-format-13
  50. - name: 'Run clang-format'
  51. run: |
  52. ./CI/check-format.sh
  53. ./CI/check-changes.sh
  54. - name: 'Install cmake-format'
  55. run: sudo pip install cmakelang
  56. - name: 'Run cmake-format'
  57. run: |
  58. ./CI/check-cmake.sh
  59. macos_build:
  60. name: '02 - macOS'
  61. runs-on: [macos-12]
  62. strategy:
  63. matrix:
  64. arch: ['x86_64', 'arm64']
  65. if: always()
  66. needs: [clang_check]
  67. env:
  68. MACOSX_DEPLOYMENT_TARGET_X86_64: '10.15'
  69. MACOSX_DEPLOYMENT_TARGET_ARM64: '11.0'
  70. SPARKLE_VERSION: '1.26.0'
  71. SPARKLE_HASH: '8312cbf7528297a49f1b97692c33cb8d33254c396dc51be394e9484e4b6833a0'
  72. BLOCKED_FORMULAS: 'speexdsp curl php composer'
  73. CODESIGN_IDENT: '-'
  74. HAVE_CODESIGN_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY != '' && secrets.MACOS_SIGNING_CERT != '' }}
  75. defaults:
  76. run:
  77. shell: bash
  78. working-directory: 'obs-studio'
  79. steps:
  80. - name: 'Checkout'
  81. uses: actions/checkout@v3
  82. with:
  83. submodules: 'recursive'
  84. path: 'obs-studio'
  85. fetch-depth: 0
  86. - name: 'Check for Github Labels'
  87. if: github.event_name == 'pull_request'
  88. run: |
  89. if test -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')"; then
  90. echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
  91. else
  92. echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
  93. fi
  94. echo "CACHE_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
  95. - name: 'Restore ccache from cache'
  96. id: ccache-cache
  97. uses: actions/cache@v3
  98. env:
  99. CACHE_NAME: 'ccache-cache'
  100. with:
  101. path: ${{ github.workspace }}/.ccache
  102. key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ matrix.arch }}-${{ env.CACHE_DATE }}
  103. - name: 'Restore Chromium Embedded Framework from cache'
  104. id: cef-cache
  105. uses: actions/cache@v3
  106. env:
  107. CACHE_NAME: 'cef-cache'
  108. with:
  109. path: ${{ github.workspace }}/obs-build-dependencies/cef_binary_${{ env.CEF_BUILD_VERSION_MAC }}_macos_${{ matrix.arch }}
  110. key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_BUILD_VERSION_MAC }}-${{ matrix.arch }}-${{ env.CACHE_REVISION }}
  111. - name: 'Restore VLC dependency from cache'
  112. id: vlc-cache
  113. uses: actions/cache@v3
  114. env:
  115. CACHE_NAME: 'vlc-cache'
  116. with:
  117. path: ${{ github.workspace }}/obs-build-dependencies/vlc-${{ env.VLC_VERSION_MAC }}
  118. key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION_MAC }}-${{ env.CACHE_REVISION }}
  119. - name: 'Restore Sparkle dependency from cache'
  120. id: sparkle-cache
  121. uses: actions/cache@v3
  122. env:
  123. CACHE_NAME: 'sparkle-cache'
  124. with:
  125. path: ${{ github.workspace }}/obs-build-dependencies/obs-deps/lib/Sparkle.framework
  126. key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.SPARKLE_VERSION }}-${{ env.CACHE_REVISION }}
  127. - name: 'Setup build environment'
  128. id: setup
  129. run: |
  130. REMOVE_FORMULAS=""
  131. for FORMULA in ${{ env.BLOCKED_FORMULAS }}; do
  132. if [ -d "/usr/local/opt/${FORMULA}" ]; then
  133. REMOVE_FORMULAS="${REMOVE_FORMULAS}${FORMULA} "
  134. fi
  135. done
  136. if [ -n "${REMOVE_FORMULAS}" ]; then
  137. brew uninstall ${REMOVE_FORMULAS}
  138. fi
  139. echo "commitHash=$(git rev-parse --short=9 HEAD)" >> $GITHUB_OUTPUT
  140. - name: 'Switch to Xcode 14.1'
  141. run: sudo xcode-select -switch /Applications/Xcode_14.1.app
  142. - name: 'Install dependencies'
  143. env:
  144. RESTORED_VLC: ${{ steps.vlc-cache.outputs.cache-hit }}
  145. RESTORED_SPARKLE: ${{ steps.sparkle-cache.outputs.cache-hit }}
  146. RESTORED_CEF: ${{ steps.cef-cache.outputs.cache-hit }}
  147. run: CI/macos/01_install_dependencies.sh --architecture "${{ matrix.arch }}"
  148. - name: 'Install Apple Developer Certificate'
  149. if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && env.HAVE_CODESIGN_IDENTITY == 'true' }}
  150. uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
  151. with:
  152. p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
  153. p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
  154. - name: 'Set Signing Identity'
  155. if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && env.HAVE_CODESIGN_IDENTITY == 'true' }}
  156. run: |
  157. echo "CODESIGN_IDENT=${{ secrets.MACOS_SIGNING_IDENTITY }}" >> $GITHUB_ENV
  158. echo "BUILD_FOR_DISTRIBUTION=ON" >> $GITHUB_ENV
  159. - name: 'Build OBS'
  160. run: CI/macos/02_build_obs.sh --codesign --architecture "${{ matrix.arch }}"
  161. - name: 'Run tests'
  162. if: ${{ success() && matrix.arch == 'x86_64' }}
  163. run: cmake --build build -t test
  164. - name: 'Create build artifact'
  165. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  166. run: |
  167. CI/macos/03_package_obs.sh --codesign --architecture "${{ matrix.arch }}"
  168. ARTIFACT_NAME=$(basename $(/usr/bin/find build -type f -name "obs-studio-*.dmg" -depth 1 | head -1))
  169. echo "FILE_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
  170. - name: 'Upload build Artifact'
  171. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  172. uses: actions/upload-artifact@v3
  173. with:
  174. name: 'obs-studio-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
  175. path: '${{ github.workspace }}/obs-studio/build/${{ env.FILE_NAME }}'
  176. linux_build:
  177. name: '02 - Linux'
  178. runs-on: ${{ matrix.ubuntu }}
  179. strategy:
  180. matrix:
  181. ubuntu: ['ubuntu-20.04', 'ubuntu-22.04']
  182. if: always()
  183. needs: [clang_check]
  184. defaults:
  185. run:
  186. shell: bash
  187. working-directory: 'obs-studio'
  188. env:
  189. BUILD_FOR_DISTRIBUTION: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
  190. steps:
  191. - name: 'Checkout'
  192. uses: actions/checkout@v3
  193. with:
  194. submodules: 'recursive'
  195. path: 'obs-studio'
  196. fetch-depth: 0
  197. - name: 'Check for Github Labels'
  198. if: github.event_name == 'pull_request'
  199. run: |
  200. if test -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')"; then
  201. echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
  202. else
  203. echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
  204. fi
  205. echo "CACHE_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
  206. - name: 'Restore ccache from cache'
  207. id: ccache-cache
  208. uses: actions/cache@v3
  209. env:
  210. CACHE_NAME: 'ccache-cache'
  211. with:
  212. path: ${{ github.workspace }}/.ccache
  213. key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ matrix.ubuntu }}-${{ env.CACHE_DATE }}
  214. - name: 'Restore Chromium Embedded Framework from cache'
  215. id: cef-cache
  216. uses: actions/cache@v3
  217. env:
  218. CACHE_NAME: 'cef-cache'
  219. with:
  220. path: ${{ github.workspace }}/obs-build-dependencies/cef_binary_${{ env.CEF_BUILD_VERSION_LINUX }}_linux64
  221. key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_BUILD_VERSION_LINUX }}-${{ env.CACHE_REVISION }}
  222. - name: 'Setup build environment'
  223. id: setup
  224. run: |
  225. echo "commitHash=$(git rev-parse --short=9 HEAD)" >> $GITHUB_OUTPUT
  226. - name: 'Install dependencies'
  227. env:
  228. RESTORED_CEF: ${{ steps.cef-cache.outputs.cache-hit }}
  229. run: CI/linux/01_install_dependencies.sh --disable-pipewire
  230. - name: 'Build OBS'
  231. run: CI/linux/02_build_obs.sh --disable-pipewire
  232. - name: 'Run tests'
  233. if: success()
  234. run: cmake --build build -t test
  235. - name: 'Create build artifact'
  236. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  237. run: |
  238. CI/linux/03_package_obs.sh
  239. ARTIFACT_NAME=$(basename $(/usr/bin/find build -maxdepth 1 -type f -name "obs-studio-*.deb" | sort -rn | head -1))
  240. echo "FILE_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
  241. echo "DEBUG_FILE_NAME=${ARTIFACT_NAME//.deb/-dbgsym.ddeb}" >> $GITHUB_ENV
  242. - name: 'Upload build Artifact'
  243. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  244. uses: actions/upload-artifact@v3
  245. with:
  246. name: 'obs-studio-${{ matrix.ubuntu }}-${{ steps.setup.outputs.commitHash }}'
  247. path: '${{ github.workspace }}/obs-studio/build/${{ env.FILE_NAME }}'
  248. - name: 'Upload debug symbol Artifact'
  249. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  250. uses: actions/upload-artifact@v3
  251. with:
  252. name: 'obs-studio-${{ matrix.ubuntu }}-${{ steps.setup.outputs.commitHash }}-dbgsym'
  253. path: '${{ github.workspace }}/obs-studio/build/${{ env.DEBUG_FILE_NAME }}'
  254. windows_build:
  255. name: '02 - Windows'
  256. runs-on: [windows-2022]
  257. needs: [clang_check]
  258. if: always()
  259. strategy:
  260. matrix:
  261. arch: [x64, x86]
  262. env:
  263. CMAKE_GENERATOR: 'Visual Studio 17 2022'
  264. CMAKE_SYSTEM_VERSION: '10.0.18363.657'
  265. VIRTUALCAM-GUID: 'A3FCE0F5-3493-419F-958A-ABA1250EC20B'
  266. BUILD_FOR_DISTRIBUTION: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
  267. defaults:
  268. run:
  269. working-directory: 'obs-studio'
  270. steps:
  271. - name: 'Checkout'
  272. uses: actions/checkout@v3
  273. with:
  274. submodules: 'recursive'
  275. path: 'obs-studio'
  276. fetch-depth: 0
  277. - name: 'Add msbuild to PATH'
  278. uses: microsoft/[email protected]
  279. - name: 'Check for Github Labels'
  280. if: github.event_name == 'pull_request'
  281. run: |
  282. $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 }
  283. Write-Output "SEEKING_TESTERS=$(if( $LabelFound -eq $true ) { 1 } else { 0 })" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
  284. - name: 'Restore VLC dependency from cache'
  285. id: vlc-cache
  286. uses: actions/cache@v3
  287. env:
  288. CACHE_NAME: 'vlc-cache'
  289. with:
  290. path: ${{ github.workspace }}/obs-build-dependencies/vlc-${{ env.VLC_VERSION_WIN }}
  291. key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION_WIN }}-${{ env.CACHE_REVISION }}
  292. - name: 'Restore Chromium Embedded Framework from cache'
  293. id: cef-cache
  294. uses: actions/cache@v3
  295. env:
  296. CACHE_NAME: 'cef-cache'
  297. with:
  298. path: ${{ github.workspace }}/obs-build-dependencies/cef_binary_${{ env.CEF_BUILD_VERSION_WIN }}_windows_${{ matrix.arch }}
  299. key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_BUILD_VERSION_WIN }}-${{ matrix.arch }}-${{ env.CACHE_REVISION }}
  300. - name: Setup Environment
  301. id: setup
  302. run: |
  303. $CommitHash = git rev-parse --short=9 HEAD
  304. "commitHash=${CommitHash}" >> $env:GITHUB_OUTPUT
  305. - name: 'Install dependencies'
  306. env:
  307. RESTORED_VLC: ${{ steps.vlc-cache.outputs.cache-hit }}
  308. RESTORED_CEF: ${{ steps.cef-cache.outputs.cache-hit }}
  309. run: CI/windows/01_install_dependencies.ps1 -BuildArch ${{ matrix.arch }}
  310. - name: 'Build OBS'
  311. run: CI/windows/02_build_obs.ps1 -BuildArch ${{ matrix.arch }}
  312. - name: 'Create build artifact'
  313. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  314. run: |
  315. CI/windows/03_package_obs.ps1 -BuildArch ${{ matrix.arch }} -Package
  316. $ArtifactName = Get-ChildItem -filter "obs-studio-*-windows-${{ matrix.arch }}.zip" -File
  317. Write-Output "FILE_NAME=${ArtifactName}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
  318. - name: 'Upload build artifact'
  319. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  320. uses: actions/upload-artifact@v3
  321. with:
  322. name: 'obs-studio-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
  323. path: '${{ env.FILE_NAME }}'
  324. linux_package:
  325. name: '02 - Flatpak Bundle'
  326. runs-on: [ubuntu-latest]
  327. needs: [clang_check]
  328. if: always()
  329. defaults:
  330. run:
  331. shell: bash
  332. container:
  333. image: bilelmoussaoui/flatpak-github-actions:kde-6.4
  334. options: --privileged
  335. steps:
  336. - name: 'Check for Github Labels'
  337. if: github.event_name == 'pull_request'
  338. run: |
  339. if ! /usr/bin/command -v "jq" >/dev/null 2>&1; then sudo dnf install -y -q jq; fi
  340. if test -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')"; then
  341. echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
  342. else
  343. echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
  344. fi
  345. - name: 'Checkout'
  346. uses: actions/checkout@v3
  347. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  348. with:
  349. submodules: 'recursive'
  350. fetch-depth: 0
  351. - name: 'Setup build environment'
  352. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  353. run: |
  354. git config --global --add safe.directory $GITHUB_WORKSPACE
  355. echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
  356. echo "OBS_GIT_HASH=$(git rev-parse --short=9 HEAD)" >> $GITHUB_ENV
  357. echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
  358. - name: Build Flatpak Manifest
  359. uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
  360. if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
  361. with:
  362. bundle: obs-studio-flatpak-${{ env.OBS_GIT_HASH }}.flatpak
  363. manifest-path: CI/flatpak/com.obsproject.Studio.json
  364. cache-key: flatpak-builder-${{ hashFiles('CI/flatpak/com.obsproject.Studio.json') }}
  365. windows_package:
  366. name: '03 - Windows Installer'
  367. runs-on: [windows-latest]
  368. needs: [windows_build]
  369. if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
  370. env:
  371. BUILD_FOR_DISTRIBUTION: 'ON'
  372. steps:
  373. - name: 'Checkout'
  374. uses: actions/checkout@v3
  375. - name: Setup Environment
  376. id: setup
  377. run: |
  378. $CommitHash = git rev-parse --short=9 HEAD
  379. "commitHash=${CommitHash}" >> $env:GITHUB_OUTPUT
  380. - name: 'Add msbuild to PATH'
  381. uses: microsoft/[email protected]
  382. - name: 'Download 64-bit artifact'
  383. uses: actions/download-artifact@v3
  384. with:
  385. name: 'obs-studio-windows-x64-${{ steps.setup.outputs.commitHash }}'
  386. - name: 'Download 32-bit artifact'
  387. uses: actions/download-artifact@v3
  388. with:
  389. name: 'obs-studio-windows-x86-${{ steps.setup.outputs.commitHash }}'
  390. - name: 'Unpack Windows build artifacts'
  391. id: unpack
  392. run: |
  393. if (!(Test-Path install_temp)) {
  394. $null = New-Item -ItemType Directory -Force -Path install_temp
  395. }
  396. Expand-Archive -Path "$(Get-ChildItem -filter "obs-studio-*-windows-x86.zip" -File)" -DestinationPath install_temp
  397. Expand-Archive -Path "$(Get-ChildItem -filter "obs-studio-*-windows-x64.zip" -File)" -Force -DestinationPath install_temp
  398. CI/windows/03_package_obs.ps1 -CombinedArchs -Package
  399. $ArtifactName = (Get-ChildItem -filter "obs-studio-*-windows-x86+x64.zip" -File).Name
  400. "filename=${ArtifactName}" >> $env:GITHUB_OUTPUT
  401. - name: 'Upload build artifact'
  402. uses: actions/upload-artifact@v3
  403. with:
  404. name: 'obs-studio-windows-installer'
  405. path: '${{ steps.unpack.outputs.filename }}'
  406. macos_release:
  407. name: '03 - macOS notarized image'
  408. runs-on: [macos-12]
  409. needs: [macos_build]
  410. env:
  411. HAVE_CODESIGN_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY != '' && secrets.MACOS_SIGNING_CERT != '' }}
  412. BUILD_FOR_DISTRIBUTION: 'ON'
  413. if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
  414. strategy:
  415. matrix:
  416. arch: ['x86_64', 'arm64']
  417. defaults:
  418. run:
  419. shell: bash
  420. steps:
  421. - name: 'Checkout'
  422. if: env.HAVE_CODESIGN_IDENTITY == 'true'
  423. uses: actions/checkout@v3
  424. - name: 'Setup build environment'
  425. id: setup
  426. run: |
  427. echo "commitHash=$(git rev-parse --short=9 HEAD)" >> $GITHUB_OUTPUT
  428. - name: 'Download artifact'
  429. if: env.HAVE_CODESIGN_IDENTITY == 'true'
  430. uses: actions/download-artifact@v3
  431. with:
  432. name: 'obs-studio-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
  433. - name: 'Install Apple Developer Certificate'
  434. if: env.HAVE_CODESIGN_IDENTITY == 'true'
  435. uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
  436. with:
  437. p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
  438. p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
  439. - name: 'Create disk image for distribution'
  440. if: env.HAVE_CODESIGN_IDENTITY == 'true'
  441. env:
  442. CODESIGN_IDENT: ${{ secrets.MACOS_SIGNING_IDENTITY }}
  443. CODESIGN_IDENT_USER: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
  444. CODESIGN_IDENT_PASS: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
  445. run: |
  446. ARTIFACT_NAME=$(/usr/bin/find . -type f -name "obs-studio-*.dmg" -depth 1 | head -1)
  447. CI/macos/03_package_obs.sh --notarize-image ${ARTIFACT_NAME}
  448. echo "FILE_NAME=$(basename ${ARTIFACT_NAME})" >> $GITHUB_ENV
  449. - name: 'Upload build Artifact'
  450. if: env.HAVE_CODESIGN_IDENTITY == 'true'
  451. uses: actions/upload-artifact@v3
  452. with:
  453. name: 'obs-studio-macos-${{ matrix.arch }}-notarized'
  454. path: '${{ github.workspace }}/${{ env.FILE_NAME }}'