1
0

flatpak.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. echo "::set-output name=commitHash::$(git rev-parse --short=9 HEAD)"
  38. - name: Build Flatpak Manifest
  39. uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@master
  40. with:
  41. bundle: obs-studio-${{ steps.setup.outputs.commitHash }}.flatpak
  42. manifest-path: CI/flatpak/com.obsproject.Studio.json
  43. cache-key: flatpak-builder-${{ hashFiles('CI/flatpak/com.obsproject.Studio.json') }}
  44. mirror-screenshots-url: https://dl.flathub.org/repo/screenshots
  45. branch: ${{ matrix.branch }}
  46. - name: Validate AppStream
  47. shell: bash
  48. working-directory: ${{ env.FLATPAK_BUILD_PATH }}
  49. run: |
  50. appstream-util validate appdata/com.obsproject.Studio.appdata.xml
  51. - name: Verify icon and metadata in app-info
  52. shell: bash
  53. working-directory: ${{ env.FLATPAK_BUILD_PATH }}
  54. run: |
  55. test -f app-info/icons/flatpak/128x128/com.obsproject.Studio.png || { echo "Missing 128x128 icon in app-info" ; exit 1; }
  56. test -f app-info/xmls/com.obsproject.Studio.xml.gz || { echo "Missing com.obsproject.Studio.xml.gz in app-info" ; exit 1; }
  57. - name: Commit screenshots to the OSTree repository
  58. run: |
  59. ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 flatpak_app/screenshots
  60. - name: Publish to Flathub Beta
  61. uses: bilelmoussaoui/flatpak-github-actions/flat-manager@v4
  62. if: matrix.branch == 'beta'
  63. with:
  64. flat-manager-url: https://hub.flathub.org/
  65. repository: beta
  66. token: ${{ secrets.FLATHUB_BETA_TOKEN }}
  67. - name: Publish to Flathub
  68. uses: bilelmoussaoui/flatpak-github-actions/flat-manager@v4
  69. if: matrix.branch == 'stable'
  70. with:
  71. flat-manager-url: https://hub.flathub.org/
  72. repository: stable
  73. token: ${{ secrets.FLATHUB_TOKEN }}