release.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. name: Build and Release (Linux)
  2. on:
  3. push:
  4. tags:
  5. - 'v*'
  6. permissions:
  7. contents: write
  8. jobs:
  9. build-linux:
  10. name: Build on Ubuntu
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Checkout repository
  14. uses: actions/checkout@v4
  15. - name: Install Flatpak & flatpak-builder
  16. run: |
  17. sudo apt-get update
  18. sudo apt-get install -y flatpak flatpak-builder
  19. flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  20. - name: Create Flatpak Manifest
  21. run: |
  22. cat <<EOF > plugin.json
  23. {
  24. "id": "com.obsproject.Studio.Plugin.CDRecStatus",
  25. "branch": "stable",
  26. "runtime": "com.obsproject.Studio",
  27. "runtime-version": "stable",
  28. "sdk": "org.freedesktop.Sdk//25.08",
  29. "build-extension": true,
  30. "modules": [
  31. {
  32. "name": "qtwebsockets",
  33. "buildsystem": "cmake-ninja",
  34. "sources": [
  35. {
  36. "type": "archive",
  37. "url": "https://download.qt.io/official_releases/qt/6.8/6.8.2/submodules/qtwebsockets-everywhere-src-6.8.2.tar.xz",
  38. "sha256": "919df562ba3446c8393992d112085ad2d96d23aaf802b1cd7a30bf3ba2fe8cbe"
  39. }
  40. ]
  41. },
  42. {
  43. "name": "cd-rec-status",
  44. "buildsystem": "cmake-ninja",
  45. "builddir": true,
  46. "config-opts": [
  47. "-DENABLE_FRONTEND_API=ON",
  48. "-DENABLE_QT=ON"
  49. ],
  50. "sources": [
  51. {
  52. "type": "dir",
  53. "path": "."
  54. }
  55. ]
  56. }
  57. ]
  58. }
  59. EOF
  60. - name: Build Plugin in Flatpak Sandbox
  61. run: flatpak-builder --user --install-deps-from=flathub --force-clean build-dir plugin.json
  62. - name: Package Artifacts
  63. run: |
  64. mkdir -p release_package/cd-rec-status/bin/64bit
  65. mkdir -p release_package/cd-rec-status/data
  66. find .flatpak-builder/build/ -name "cd-rec-status.so" -exec cp {} release_package/cd-rec-status/bin/64bit/ \;
  67. cp -r data/* release_package/cd-rec-status/data/
  68. cd release_package
  69. tar -czvf ../cd-rec-status-linux-x86_64.tar.gz .
  70. - name: Upload Build Artifact
  71. uses: actions/upload-artifact@v4
  72. with:
  73. name: cd-rec-status-linux-x86_64
  74. path: cd-rec-status-linux-x86_64.tar.gz
  75. release:
  76. name: Create GitHub Release
  77. needs: build-linux
  78. runs-on: ubuntu-latest
  79. steps:
  80. - name: Download artifacts
  81. uses: actions/download-artifact@v4
  82. with:
  83. path: artifacts
  84. merge-multiple: true
  85. - name: Publish Release
  86. uses: softprops/action-gh-release@v2
  87. with:
  88. files: artifacts/*.tar.gz
  89. generate_release_notes: true