| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- name: Build and Release (Linux)
- on:
- push:
- tags:
- - 'v*'
- permissions:
- contents: write
- jobs:
- build-linux:
- name: Build on Ubuntu
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
- - name: Install Flatpak & Utilities
- run: |
- sudo apt-get update
- sudo apt-get install -y flatpak flatpak-builder patchelf
- flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- - name: Create Flatpak Manifest
- run: |
- cat <<EOF > plugin.json
- {
- "id": "com.obsproject.Studio.Plugin.CDRecStatus",
- "branch": "stable",
- "runtime": "com.obsproject.Studio",
- "runtime-version": "stable",
- "sdk": "org.freedesktop.Sdk//25.08",
- "build-extension": true,
- "build-options": {
- "prefix": "/app/plugins/cd-rec-status"
- },
- "modules": [
- {
- "name": "qtwebsockets",
- "buildsystem": "cmake-ninja",
- "build-options": {
- "prefix": "/app/plugins/cd-rec-status/qtws"
- },
- "sources": [
- {
- "type": "archive",
- "url": "https://download.qt.io/official_releases/qt/6.8/6.8.2/submodules/qtwebsockets-everywhere-src-6.8.2.tar.xz",
- "sha256": "919df562ba3446c8393992d112085ad2d96d23aaf802b1cd7a30bf3ba2fe8cbe"
- }
- ]
- },
- {
- "name": "cd-rec-status",
- "buildsystem": "cmake-ninja",
- "builddir": true,
- "config-opts": [
- "-DENABLE_FRONTEND_API=ON",
- "-DENABLE_QT=ON",
- "-DQt6WebSockets_DIR=/app/plugins/cd-rec-status/qtws/lib/cmake/Qt6WebSockets"
- ],
- "sources": [
- {
- "type": "dir",
- "path": "."
- }
- ]
- }
- ]
- }
- EOF
- - name: Build Plugin in Flatpak Sandbox
- run: flatpak-builder --user --install-deps-from=flathub --force-clean build-dir plugin.json
- - name: Package Artifacts
- run: |
- mkdir -p release_package/cd-rec-status/bin/64bit
- mkdir -p release_package/cd-rec-status/data
-
- find .flatpak-builder/build/cd-rec-status-* -name "cd-rec-status.so" -exec cp {} release_package/cd-rec-status/bin/64bit/ \;
- find .flatpak-builder/build/qtwebsockets-* -name "libQt6WebSockets.so*" -exec cp -a {} release_package/cd-rec-status/bin/64bit/ \;
- patchelf --force-rpath --set-rpath '$ORIGIN' release_package/cd-rec-status/bin/64bit/cd-rec-status.so
-
- cp -r data/* release_package/cd-rec-status/data/
-
- cd release_package
- tar -czvf ../cd-rec-status-linux-x86_64.tar.gz .
- - name: Upload Build Artifact
- uses: actions/upload-artifact@v4
- with:
- name: cd-rec-status-linux-x86_64
- path: cd-rec-status-linux-x86_64.tar.gz
- release:
- name: Create GitHub Release
- needs: build-linux
- runs-on: ubuntu-latest
- steps:
- - name: Download artifacts
- uses: actions/download-artifact@v4
- with:
- path: artifacts
- merge-multiple: true
- - name: Publish Release
- uses: softprops/action-gh-release@v2
- with:
- files: artifacts/*.tar.gz
- generate_release_notes: true
|