push.yaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. name: Push
  2. run-name: ${{ github.ref_name }} push run 🚀
  3. on:
  4. push:
  5. paths-ignore:
  6. - '**.md'
  7. branches:
  8. - master
  9. - 'release/**'
  10. tags:
  11. - '*'
  12. permissions:
  13. contents: write
  14. jobs:
  15. check-format:
  16. name: Format 🔍
  17. if: github.ref_name == 'master'
  18. uses: ./.github/workflows/check-format.yaml
  19. permissions:
  20. contents: read
  21. build-project:
  22. name: Build 🧱
  23. uses: ./.github/workflows/build-project.yaml
  24. secrets: inherit
  25. permissions:
  26. contents: read
  27. compatibility-validation:
  28. name: Validate Compatibility 🕵️
  29. if: github.ref_name == 'master'
  30. runs-on: ubuntu-22.04
  31. permissions:
  32. checks: write
  33. steps:
  34. - uses: actions/checkout@v4
  35. with:
  36. fetch-depth: 0
  37. - name: Check for Changed Files ✅
  38. uses: ./.github/actions/check-changes
  39. id: checks
  40. with:
  41. baseRef: ${{ github.event.before }}
  42. checkGlob: plugins/win-capture/data/*.json
  43. - name: Check for Invalid Compatibility Data 📉
  44. if: fromJSON(steps.checks.outputs.hasChangedFiles)
  45. uses: ./.github/actions/compatibility-validator
  46. with:
  47. repositorySecret: ${{ github.token }}
  48. services-validation:
  49. name: Validate Services 🕵️
  50. if: github.ref_name == 'master'
  51. runs-on: ubuntu-22.04
  52. permissions:
  53. checks: write
  54. steps:
  55. - uses: actions/checkout@v4
  56. with:
  57. fetch-depth: 0
  58. - name: Check for Changed Files ✅
  59. uses: ./.github/actions/check-changes
  60. id: checks
  61. with:
  62. baseRef: ${{ github.event.before }}
  63. checkGlob: plugins/rtmp-services/data/*.json
  64. - name: Check Services JSON Schema 📉
  65. if: fromJSON(steps.checks.outputs.hasChangedFiles)
  66. uses: ./.github/actions/services-validator
  67. with:
  68. repositorySecret: ${{ github.token }}
  69. runSchemaChecks: true
  70. runServiceChecks: false
  71. update-documentation:
  72. name: Update Documentation 📖
  73. if: github.repository_owner == 'obsproject' && (github.ref_name == 'master' || github.ref_type == 'tag')
  74. runs-on: ubuntu-22.04
  75. steps:
  76. - uses: actions/checkout@v4
  77. with:
  78. fetch-depth: 0
  79. - name: Check for Changed Files ✅
  80. if: github.ref_type != 'tag'
  81. uses: ./.github/actions/check-changes
  82. id: checks
  83. with:
  84. baseRef: ${{ github.event.before }}
  85. checkGlob: '!(cmake*)'
  86. - uses: ./.github/actions/generate-docs
  87. if: github.ref_type == 'tag' || fromJSON(steps.checks.outputs.hasChangedFiles)
  88. with:
  89. disableLinkExtensions: ${{ github.ref_type == 'tag' }}
  90. deploy-documentation:
  91. name: Deploy Documentation to Cloudflare ☁️
  92. if: github.repository_owner == 'obsproject' && github.ref_type == 'tag'
  93. runs-on: ubuntu-22.04
  94. needs: update-documentation
  95. defaults:
  96. run:
  97. shell: bash
  98. environment:
  99. name: cf-pages-deploy
  100. steps:
  101. - name: Get Commit Information 🆔
  102. id: setup
  103. run: |
  104. : Get Commit Hash 🆔
  105. echo "commitHash=${GITHUB_SHA:0:9}" >> $GITHUB_OUTPUT
  106. - uses: actions/download-artifact@v4
  107. with:
  108. name: OBS Studio Docs (No Extensions) ${{ steps.setup.outputs.commitHash }}
  109. path: docs
  110. - name: Set Up Redirects 🔄
  111. run: |
  112. : Set Up Redirects 🔄
  113. if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
  114. echo "/previous/27.2 https://obsproject.com/docs/27.2 302" >> docs/_redirects
  115. echo "/previous/:major.:minor https://:major-:minor.${{ vars.CF_PAGES_PROJECT }}.pages.dev 302" >> docs/_redirects
  116. - name: Publish to Live Page
  117. uses: cloudflare/wrangler-action@4c10c1822abba527d820b29e6333e7f5dac2cabd
  118. with:
  119. workingDirectory: docs
  120. apiToken: ${{ secrets.CF_API_TOKEN }}
  121. accountId: ${{ secrets.CF_ACCOUNT_ID }}
  122. command: pages publish . --project-name=${{ vars.CF_PAGES_PROJECT }} --commit-hash='${{ steps.setup.outputs.commitHash }}'
  123. create-appcast:
  124. name: Create Sparkle Appcast 🎙️
  125. if: github.repository_owner == 'obsproject' && github.ref_type == 'tag'
  126. runs-on: macos-14
  127. needs: build-project
  128. strategy:
  129. fail-fast: false
  130. matrix:
  131. target: [arm64, x86_64]
  132. defaults:
  133. run:
  134. shell: zsh --no-rcs --errexit --pipefail {0}
  135. steps:
  136. - uses: actions/checkout@v4
  137. with:
  138. submodules: recursive
  139. fetch-depth: 0
  140. ref: ${{ github.ref }}
  141. - name: Set Up Environment 🔧
  142. id: setup
  143. run: |
  144. : Set Up Environment 🔧
  145. if (( ${+RUNNER_DEBUG} )) setopt XTRACE
  146. local channel='stable'
  147. if [[ ${GITHUB_REF_NAME} == *(beta|rc)* ]] {
  148. channel='beta'
  149. }
  150. local -A arch_names=(x86_64 intel arm64 apple)
  151. print "cpuName=${arch_names[${{ matrix.target }}]}" >> $GITHUB_OUTPUT
  152. print "commitHash=${GITHUB_SHA:0:9}" >> $GITHUB_OUTPUT
  153. print "channel=${channel}" >> $GITHUB_OUTPUT
  154. - name: Download Artifact 📥
  155. uses: actions/download-artifact@v4
  156. with:
  157. name: obs-studio-macos-${{ matrix.target }}-${{ steps.setup.outputs.commitHash }}
  158. - name: Generate Appcast 🎙️
  159. id: generate-appcast
  160. uses: ./.github/actions/sparkle-appcast
  161. with:
  162. sparklePrivateKey: ${{ secrets.SPARKLE_PRIVATE_KEY }}
  163. baseImage: ${{ github.workspace }}/obs-studio-*-macos-${{ steps.setup.outputs.cpuName }}.dmg
  164. channel: ${{ steps.setup.outputs.channel }}
  165. count: 1
  166. urlPrefix: 'https://cdn-fastly.obsproject.com/downloads'
  167. customTitle: 'OBS Studio'
  168. customLink: 'https://obsproject.com/'
  169. - name: Upload Artifacts 📡
  170. uses: actions/upload-artifact@v4
  171. with:
  172. name: macos-sparkle-update-${{ matrix.target }}
  173. path: ${{ github.workspace }}/output
  174. merge-appcasts:
  175. runs-on: ubuntu-22.04
  176. needs: create-appcast
  177. steps:
  178. - name: Merge Appcasts
  179. uses: actions/upload-artifact/merge@v4
  180. with:
  181. name: macos-sparkle-update
  182. pattern: macos-sparkle-update-*
  183. delete-merged: true
  184. sign-windows-build:
  185. name: Windows Signing ✍️
  186. uses: obsproject/obs-studio/.github/workflows/sign-windows.yaml@b5b457d7b059397b70f6e3dd09b65e172ad734c3
  187. if: github.repository_owner == 'obsproject' && github.ref_type == 'tag'
  188. needs: build-project
  189. permissions:
  190. contents: 'read'
  191. id-token: 'write'
  192. attestations: 'write'
  193. secrets: inherit
  194. create-release:
  195. name: Create Release 🛫
  196. if: github.ref_type == 'tag'
  197. runs-on: ubuntu-22.04
  198. needs: [build-project, sign-windows-build]
  199. defaults:
  200. run:
  201. shell: bash
  202. steps:
  203. - name: Check Release Tag ☑️
  204. id: check
  205. run: |
  206. : Check Release Tag ☑️
  207. if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
  208. shopt -s extglob
  209. case "${GITHUB_REF_NAME}" in
  210. +([0-9]).+([0-9]).+([0-9]) )
  211. echo 'validTag=true' >> $GITHUB_OUTPUT
  212. echo 'prerelease=false' >> $GITHUB_OUTPUT
  213. echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
  214. ;;
  215. +([0-9]).+([0-9]).+([0-9])-@(beta|rc)*([0-9]) )
  216. echo 'validTag=true' >> $GITHUB_OUTPUT
  217. echo 'prerelease=true' >> $GITHUB_OUTPUT
  218. echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
  219. ;;
  220. *) echo 'validTag=false' >> $GITHUB_OUTPUT ;;
  221. esac
  222. - name: Download Build Artifacts 📥
  223. uses: actions/download-artifact@v4
  224. if: ${{ fromJSON(steps.check.outputs.validTag) }}
  225. - name: Rename Files 🏷️
  226. if: fromJSON(steps.check.outputs.validTag)
  227. run: |
  228. : Rename Files 🏷️
  229. if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
  230. root_dir="${PWD}"
  231. commit_hash="${GITHUB_SHA:0:9}"
  232. macos_arm64_artifact_name="obs-studio-macos-arm64-${commit_hash}"
  233. macos_arm64_dsym_artifact_name="obs-studio-macos-arm64-${commit_hash}-dSYMs"
  234. macos_intel_artifact_name="obs-studio-macos-x86_64-${commit_hash}"
  235. macos_intel_dsym_artifact_name="obs-studio-macos-x86_64-${commit_hash}-dSYMs"
  236. ubuntu_2204_x86_64_artifact_name="obs-studio-ubuntu-22.04-x86_64-${commit_hash}"
  237. ubuntu_2204_x86_64_debug_name="obs-studio-ubuntu-22.04-x86_64-${commit_hash}-dbgsym"
  238. ubuntu_2404_x86_64_artifact_name="obs-studio-ubuntu-24.04-x86_64-${commit_hash}"
  239. ubuntu_2404_x86_64_debug_name="obs-studio-ubuntu-24.04-x86_64-${commit_hash}-dbgsym"
  240. ubuntu_2404_sources_name="obs-studio-ubuntu-24.04-sources-${commit_hash}"
  241. windows_artifact_name="obs-studio-windows-x64-${{ steps.check.outputs.version }}-signed"
  242. windows_installer_name="obs-studio-windows-x64-${{ steps.check.outputs.version }}-installer"
  243. windows_debug_name="obs-studio-windows-x64-${{ steps.check.outputs.version }}-pdbs"
  244. echo '::group::Renaming Artifacts'
  245. mv -v "${macos_arm64_artifact_name}/"obs-studio-*-macos-apple.dmg \
  246. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-macOS-Apple.dmg
  247. mv -v "${macos_arm64_dsym_artifact_name}/"obs-studio-*-macos-apple-dSYMs.tar.xz \
  248. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-macOS-Apple-dSYMs.tar.xz
  249. mv -v "${macos_intel_artifact_name}/"obs-studio-*-macos-intel.dmg \
  250. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-macOS-Intel.dmg
  251. mv -v "${macos_intel_dsym_artifact_name}/"obs-studio-*-macos-intel-dSYMs.tar.xz \
  252. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-macOS-Intel-dSYMs.tar.xz
  253. mv -v "${ubuntu_2204_x86_64_artifact_name}/"obs-studio-*-x86_64-linux-gnu.deb \
  254. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-22.04-x86_64.deb
  255. mv -v "${ubuntu_2204_x86_64_debug_name}/"obs-studio-*-x86_64-linux-gnu-dbgsym.ddeb \
  256. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-22.04-x86_64-dbsym.ddeb
  257. mv -v "${ubuntu_2404_x86_64_artifact_name}/"obs-studio-*-x86_64-linux-gnu.deb \
  258. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-24.04-x86_64.deb
  259. mv -v "${ubuntu_2404_x86_64_debug_name}/"obs-studio-*-x86_64-linux-gnu-dbgsym.ddeb \
  260. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-24.04-x86_64-dbsym.ddeb
  261. mv -v "${ubuntu_2404_sources_name}/"obs-studio-*-sources.tar.gz \
  262. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Sources.tar.gz
  263. mv -v "${windows_installer_name}/"OBS-Studio-*.exe \
  264. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Windows-Installer.exe
  265. mv -v "${windows_artifact_name}/"OBS-Studio-*.zip \
  266. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Windows.zip
  267. mv -v "${windows_debug_name}/"OBS-Studio-*-pdbs.zip \
  268. "${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Windows-PDBs.zip
  269. echo '::endgroup::'
  270. - name: Generate Checksums 🪪
  271. if: fromJSON(steps.check.outputs.validTag)
  272. run: |
  273. : Generate Checksums 🪪
  274. if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
  275. shopt -s extglob
  276. echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
  277. for file in ${{ github.workspace }}/@(*.deb|*.ddeb|*.dmg|*.tar.xz|*.tar.gz|*.exe|*.zip); do
  278. echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt
  279. done
  280. - name: Create Release 🛫
  281. if: fromJSON(steps.check.outputs.validTag)
  282. id: create_release
  283. uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
  284. with:
  285. draft: true
  286. prerelease: ${{ fromJSON(steps.check.outputs.prerelease) }}
  287. tag_name: ${{ steps.check.outputs.version }}
  288. name: OBS Studio ${{ steps.check.outputs.version }}
  289. body_path: ${{ github.workspace }}/CHECKSUMS.txt
  290. files: |
  291. ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-macOS-*.dmg
  292. ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-macOS-*-dSYMs.tar.xz
  293. ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-*.deb
  294. ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-*.ddeb
  295. ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Sources.tar.gz
  296. ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Windows.zip
  297. ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Windows-PDBs.zip
  298. ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Windows-Installer.exe