flatpak.yml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ---
  2. name: Flatpak
  3. on:
  4. release:
  5. types: [published]
  6. branches: [master, 'release/**']
  7. env:
  8. TWITCH_CLIENTID: ${{ secrets.TWITCH_CLIENT_ID }}
  9. TWITCH_HASH: ${{ secrets.TWITCH_HASH }}
  10. RESTREAM_CLIENTID: ${{ secrets.RESTREAM_CLIENTID }}
  11. RESTREAM_HASH: ${{ secrets.RESTREAM_HASH }}
  12. YOUTUBE_CLIENTID: ${{ secrets.YOUTUBE_CLIENTID }}
  13. YOUTUBE_CLIENTID_HASH: ${{ secrets.YOUTUBE_CLIENTID_HASH }}
  14. YOUTUBE_SECRET: ${{ secrets.YOUTUBE_SECRET }}
  15. YOUTUBE_SECRET_HASH: ${{ secrets.YOUTUBE_SECRET_HASH }}
  16. jobs:
  17. publish:
  18. name: Publish to Flathub
  19. runs-on: [ubuntu-latest]
  20. if: "${{ github.event_name == 'release' && ( matrix.branch != 'stable' || (!contains(github.ref, '-beta') && !contains(github.ref, '-rc')) ) }}"
  21. env:
  22. FLATPAK_BUILD_PATH: flatpak_app/files/share
  23. container:
  24. image: bilelmoussaoui/flatpak-github-actions:kde-5.15-21.08
  25. options: --privileged
  26. strategy:
  27. matrix:
  28. branch: [stable, beta]
  29. steps:
  30. - name: Checkout
  31. uses: actions/checkout@v3
  32. with:
  33. submodules: 'recursive'
  34. - name: 'Setup build environment'
  35. id: setup
  36. run: |
  37. git config --global --add safe.directory $GITHUB_WORKSPACE
  38. echo "::set-output name=commitHash::$(git rev-parse --short=9 HEAD)"
  39. - name: Build Flatpak Manifest
  40. uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@master
  41. with:
  42. bundle: obs-studio-${{ steps.setup.outputs.commitHash }}.flatpak
  43. manifest-path: CI/flatpak/com.obsproject.Studio.json
  44. cache-key: flatpak-builder-${{ hashFiles('CI/flatpak/com.obsproject.Studio.json') }}
  45. mirror-screenshots-url: https://dl.flathub.org/repo/screenshots
  46. branch: ${{ matrix.branch }}
  47. - name: Validate AppStream
  48. shell: bash
  49. working-directory: ${{ env.FLATPAK_BUILD_PATH }}
  50. run: |
  51. appstream-util validate appdata/com.obsproject.Studio.appdata.xml
  52. - name: Verify icon and metadata in app-info
  53. shell: bash
  54. working-directory: ${{ env.FLATPAK_BUILD_PATH }}
  55. run: |
  56. test -f app-info/icons/flatpak/128x128/com.obsproject.Studio.png || { echo "Missing 128x128 icon in app-info" ; exit 1; }
  57. test -f app-info/xmls/com.obsproject.Studio.xml.gz || { echo "Missing com.obsproject.Studio.xml.gz in app-info" ; exit 1; }
  58. - name: Commit screenshots to the OSTree repository
  59. run: |
  60. ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 flatpak_app/screenshots
  61. - name: Publish to Flathub Beta
  62. uses: bilelmoussaoui/flatpak-github-actions/flat-manager@v4
  63. if: matrix.branch == 'beta'
  64. with:
  65. flat-manager-url: https://hub.flathub.org/
  66. repository: beta
  67. token: ${{ secrets.FLATHUB_BETA_TOKEN }}
  68. - name: Publish to Flathub
  69. uses: bilelmoussaoui/flatpak-github-actions/flat-manager@v4
  70. if: matrix.branch == 'stable'
  71. with:
  72. flat-manager-url: https://hub.flathub.org/
  73. repository: stable
  74. token: ${{ secrets.FLATHUB_TOKEN }}