release.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. # This JSON file tells flatpak-builder exactly how to compile the plugin
  23. # against the OBS Studio runtime.
  24. cat <<EOF > plugin.json
  25. {
  26. "id": "com.obsproject.Studio.Plugin.CDRecStatus",
  27. "branch": "stable",
  28. "runtime": "com.obsproject.Studio",
  29. "runtime-version": "stable",
  30. "sdk": "org.freedesktop.Sdk//25.08",
  31. "build-extension": true,
  32. "build-options": {
  33. "prefix": "/app/plugins/cd-rec-status"
  34. },
  35. "modules": [
  36. {
  37. "name": "cd-rec-status",
  38. "buildsystem": "cmake-ninja",
  39. "builddir": true,
  40. "config-opts": [
  41. "-DENABLE_FRONTEND_API=ON",
  42. "-DENABLE_QT=ON"
  43. ],
  44. "sources": [
  45. {
  46. "type": "dir",
  47. "path": "."
  48. }
  49. ]
  50. }
  51. ]
  52. }
  53. EOF
  54. - name: Build Plugin in Flatpak Sandbox
  55. run: flatpak-builder --user --install-deps-from=flathub --force-clean build-dir plugin.json
  56. - name: Package Artifacts
  57. run: |
  58. mkdir -p release_package/cd-rec-status/bin/64bit
  59. mkdir -p release_package/cd-rec-status/data
  60. find .flatpak-builder/build/ -name "cd-rec-status.so" -exec cp {} release_package/cd-rec-status/bin/64bit/ \;
  61. cp -r data/* release_package/cd-rec-status/data/
  62. cd release_package
  63. tar -czvf ../cd-rec-status-linux-x86_64.tar.gz .
  64. - name: Upload Build Artifact
  65. uses: actions/upload-artifact@v4
  66. with:
  67. name: cd-rec-status-linux-x86_64
  68. path: cd-rec-status-linux-x86_64.tar.gz
  69. release:
  70. name: Create GitHub Release
  71. needs: build-linux
  72. runs-on: ubuntu-latest
  73. steps:
  74. - name: Download artifacts
  75. uses: actions/download-artifact@v4
  76. with:
  77. path: artifacts
  78. merge-multiple: true
  79. - name: Publish Release
  80. uses: softprops/action-gh-release@v2
  81. with:
  82. files: artifacts/*.tar.gz
  83. generate_release_notes: true