Skip to content

Commit 3162732

Browse files
committed
WIP Stupid test
1 parent d660a72 commit 3162732

File tree

1 file changed

+67
-5
lines changed

1 file changed

+67
-5
lines changed

.github/workflows/main.yml

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ jobs:
369369
name: 'obs-studio-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
370370
path: '${{ env.FILE_NAME }}'
371371

372-
linux_package:
373-
name: '02 - Flatpak Bundle'
372+
pre_linux_package:
373+
name: '03 - Partial Flatpak Build'
374374
runs-on: [ubuntu-latest]
375375
needs: [clang_check]
376376
if: always()
@@ -409,20 +409,82 @@ jobs:
409409
echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
410410
echo "OBS_GIT_HASH=$(git rev-parse --short=9 HEAD)" >> $GITHUB_ENV
411411
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
412+
echo "MANIFEST_HASH=$(cat CI/flatpak/com.obsproject.Studio.json | sha256sum | cut -d " " -f 1)" >> $GITHUB_ENV
413+
414+
- name: Setup QEMU for non-x86_64
415+
if: ${{ success() && matrix.arch != 'x86_64' && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
416+
uses: docker/setup-qemu-action@v2
417+
with:
418+
platforms: arm64
419+
420+
- name: 'Shorten Manifest for Partial Build'
421+
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
422+
run: |
423+
jq 'del(.modules[-2:]) | .command="ls"' CI/flatpak/com.obsproject.Studio.json > tmp.json && mv tmp.json CI/flatpak/com.obsproject.Studio.json
424+
425+
- name: Build Flatpak Manifest
426+
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@master
427+
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
428+
with:
429+
build-bundle: false
430+
manifest-path: CI/flatpak/com.obsproject.Studio.json
431+
cache-key: flatpak-builder-${{ env.MANIFEST_HASH }}
432+
arch: ${{ matrix.arch }}
433+
434+
linux_package:
435+
name: '02 - Flatpak Bundle'
436+
runs-on: [ubuntu-latest]
437+
needs: [pre_linux_package]
438+
strategy:
439+
matrix:
440+
arch: [x86_64, aarch64]
441+
defaults:
442+
run:
443+
shell: bash
444+
container:
445+
image: bilelmoussaoui/flatpak-github-actions:kde-6.4
446+
options: --privileged
447+
steps:
448+
- name: 'Check for Github Labels'
449+
if: github.event_name == 'pull_request'
450+
run: |
451+
if ! /usr/bin/command -v "jq" >/dev/null 2>&1; then sudo dnf install -y -q jq; fi
452+
if test -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')"; then
453+
echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
454+
else
455+
echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
456+
fi
457+
458+
- name: 'Checkout'
459+
uses: actions/checkout@v3
460+
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
461+
with:
462+
submodules: 'recursive'
463+
fetch-depth: 0
464+
465+
- name: 'Setup build environment'
466+
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
467+
run: |
468+
[ "${{ matrix.arch }}" != "x86_64" ] && dnf install -y -q docker
469+
git config --global --add safe.directory $GITHUB_WORKSPACE
470+
echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
471+
echo "OBS_GIT_HASH=$(git rev-parse --short=9 HEAD)" >> $GITHUB_ENV
472+
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
473+
echo "MANIFEST_HASH=$(cat CI/flatpak/com.obsproject.Studio.json | sha256sum | cut -d " " -f 1)" >> $GITHUB_ENV
412474
413-
- name: Setup QEMU
475+
- name: Setup QEMU for non-x86_64
414476
if: ${{ success() && matrix.arch != 'x86_64' && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
415477
uses: docker/setup-qemu-action@v2
416478
with:
417479
platforms: arm64
418480

419481
- name: Build Flatpak Manifest
420-
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
482+
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@master
421483
if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }}
422484
with:
423485
bundle: obs-studio-flatpak-${{ env.OBS_GIT_HASH }}.flatpak
424486
manifest-path: CI/flatpak/com.obsproject.Studio.json
425-
cache-key: flatpak-builder-${{ hashFiles('CI/flatpak/com.obsproject.Studio.json') }}
487+
cache-key: flatpak-builder-${{ env.MANIFEST_HASH }}
426488
arch: ${{ matrix.arch }}
427489

428490
windows_package:

0 commit comments

Comments
 (0)