release.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 & Utilities
  16. run: |
  17. sudo apt-get update
  18. sudo apt-get install -y flatpak flatpak-builder patchelf
  19. flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  20. - name: Create Flatpak Manifest
  21. - name: Create Flatpak Manifest
  22. run: |
  23. cat <<EOF > plugin.json
  24. {
  25. "id": "com.obsproject.Studio.Plugin.CDRecStatus",
  26. "branch": "stable",
  27. "runtime": "com.obsproject.Studio",
  28. "runtime-version": "stable",
  29. "sdk": "org.freedesktop.Sdk//25.08",
  30. "build-extension": true,
  31. "build-options": {
  32. "prefix": "/app/plugins/cd-rec-status"
  33. },
  34. "modules": [
  35. {
  36. "name": "qtwebsockets",
  37. "buildsystem": "cmake-ninja",
  38. "sources": [
  39. {
  40. "type": "archive",
  41. "url": "https://download.qt.io/official_releases/qt/6.8/6.8.2/submodules/qtwebsockets-everywhere-src-6.8.2.tar.xz",
  42. "sha256": "919df562ba3446c8393992d112085ad2d96d23aaf802b1cd7a30bf3ba2fe8cbe"
  43. }
  44. ]
  45. },
  46. {
  47. "name": "cd-rec-status",
  48. "buildsystem": "cmake-ninja",
  49. "builddir": true,
  50. "config-opts": [
  51. "-DENABLE_FRONTEND_API=ON",
  52. "-DENABLE_QT=ON",
  53. "-DQt6WebSockets_DIR=/app/plugins/cd-rec-status/lib/cmake/Qt6WebSockets"
  54. ],
  55. "sources": [
  56. {
  57. "type": "dir",
  58. "path": "."
  59. }
  60. ]
  61. }
  62. ]
  63. }
  64. EOF
  65. - name: Build Plugin in Flatpak Sandbox
  66. run: flatpak-builder --user --install-deps-from=flathub --force-clean build-dir plugin.json
  67. - name: Package Artifacts
  68. run: |
  69. mkdir -p release_package/cd-rec-status/bin/64bit
  70. mkdir -p release_package/cd-rec-status/data
  71. find .flatpak-builder/build/cd-rec-status-* -name "cd-rec-status.so" -exec cp {} release_package/cd-rec-status/bin/64bit/ \;
  72. find .flatpak-builder/build/qtwebsockets-* -name "libQt6WebSockets.so*" -exec cp -a {} release_package/cd-rec-status/bin/64bit/ \;
  73. patchelf --force-rpath --set-rpath '$ORIGIN' release_package/cd-rec-status/bin/64bit/cd-rec-status.so
  74. cp -r data/* release_package/cd-rec-status/data/
  75. cd release_package
  76. tar -czvf ../cd-rec-status-linux-x86_64.tar.gz .
  77. - name: Upload Build Artifact
  78. uses: actions/upload-artifact@v4
  79. with:
  80. name: cd-rec-status-linux-x86_64
  81. path: cd-rec-status-linux-x86_64.tar.gz
  82. release:
  83. name: Create GitHub Release
  84. needs: build-linux
  85. runs-on: ubuntu-latest
  86. steps:
  87. - name: Download artifacts
  88. uses: actions/download-artifact@v4
  89. with:
  90. path: artifacts
  91. merge-multiple: true
  92. - name: Publish Release
  93. uses: softprops/action-gh-release@v2
  94. with:
  95. files: artifacts/*.tar.gz
  96. generate_release_notes: true