release.yml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. "config-opts": [
  40. "-DENABLE_FRONTEND_API=ON",
  41. "-DENABLE_QT=ON"
  42. ],
  43. "sources": [
  44. {
  45. "type": "dir",
  46. "path": "."
  47. }
  48. ]
  49. }
  50. ]
  51. }
  52. EOF
  53. - name: Build Plugin in Flatpak Sandbox
  54. run: flatpak-builder --user --install-deps-from=flathub --force-clean build-dir plugin.json
  55. - name: Package Artifacts
  56. run: |
  57. mkdir -p release_package/cd-rec-status/bin/64bit
  58. mkdir -p release_package/cd-rec-status/data
  59. find .flatpak-builder/build/ -name "cd-rec-status.so" -exec cp {} release_package/cd-rec-status/bin/64bit/ \;
  60. cp -r data/* release_package/cd-rec-status/data/
  61. cd release_package
  62. tar -czvf ../cd-rec-status-linux-x86_64.tar.gz .
  63. - name: Upload Build Artifact
  64. uses: actions/upload-artifact@v4
  65. with:
  66. name: cd-rec-status-linux-x86_64
  67. path: cd-rec-status-linux-x86_64.tar.gz
  68. release:
  69. name: Create GitHub Release
  70. needs: build-linux
  71. runs-on: ubuntu-latest
  72. steps:
  73. - name: Download artifacts
  74. uses: actions/download-artifact@v4
  75. with:
  76. path: artifacts
  77. merge-multiple: true
  78. - name: Publish Release
  79. uses: softprops/action-gh-release@v2
  80. with:
  81. files: artifacts/*.tar.gz
  82. generate_release_notes: true