From 8b87a0c71b2a93975e32ec023ad0335538a1a45d Mon Sep 17 00:00:00 2001 From: PancakeTAS Date: Fri, 29 Aug 2025 12:22:22 +0200 Subject: [PATCH] workflows: better manual dispatch --- .github/workflows/build.yml | 2 - .github/workflows/build_ci.yml | 2 - .github/workflows/flatpak_test.yml | 38 ----------- .github/workflows/package_test.yml | 48 -------------- .../workflows/{build_test.yml => test.yml} | 63 +++++++++++++++++-- src/config/config.cpp | 3 +- 6 files changed, 59 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/flatpak_test.yml delete mode 100644 .github/workflows/package_test.yml rename .github/workflows/{build_test.yml => test.yml} (54%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83e9efa..c8ce389 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,8 +11,6 @@ jobs: # prepare system - name: Checkout repository uses: actions/checkout@v4 - with: - submodules: true - name: Install build dependencies uses: awalsh128/cache-apt-pkgs-action@latest with: diff --git a/.github/workflows/build_ci.yml b/.github/workflows/build_ci.yml index 36a89f3..783d93b 100644 --- a/.github/workflows/build_ci.yml +++ b/.github/workflows/build_ci.yml @@ -11,8 +11,6 @@ jobs: # prepare system - name: Checkout repository uses: actions/checkout@v4 - with: - submodules: true - name: Install build dependencies uses: awalsh128/cache-apt-pkgs-action@latest with: diff --git a/.github/workflows/flatpak_test.yml b/.github/workflows/flatpak_test.yml deleted file mode 100644 index cdeb271..0000000 --- a/.github/workflows/flatpak_test.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: (Manual) Build lsfg-vk for Flatpak - -on: ["workflow_dispatch"] - -jobs: - flatpak-extensions: - runs-on: ubuntu-latest - strategy: - matrix: - version: ["23.08", "24.08"] - container: - image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-${{ matrix.version }} - options: --privileged - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Build Flatpak extension (${{ matrix.version }}) - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 - with: - bundle: "org.freedesktop.Platform.VulkanLayer.lsfg_vk_${{ matrix.version }}.flatpak" - manifest-path: "flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_${{ matrix.version }}.yml" - branch: "${{ matrix.version }}" - cache: false - flatpak-ui: - runs-on: ubuntu-latest - container: - image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48 - options: --privileged - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Build Flatpak - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 - with: - bundle: "gay.pancake.lsfg-vk-ui.flatpak" - manifest-path: "flatpak/gay.pancake.lsfg-vk-ui.yml" - branch: "develop" - cache: false diff --git a/.github/workflows/package_test.yml b/.github/workflows/package_test.yml deleted file mode 100644 index 388b898..0000000 --- a/.github/workflows/package_test.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: (Manual) Package lsfg-vk -run-name: ${{ github.event.workflow_run.head_commit.message }} - -on: - workflow_run: - workflows: ["(Manual) Build lsfg-vk"] - types: - - completed - -jobs: - package: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.event.workflow_run.head_sha }} - fetch-depth: 0 - - name: Download lsfg-vk artifacts - uses: actions/download-artifact@v4 - with: - name: lsfg-vk - path: . - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - - name: Package lsfg-vk for various distros - run: | - chmod +x ./package/package.sh - ./package/package.sh - - name: Upload lsfg-vk for dpkg - uses: actions/upload-artifact@v4 - with: - name: lsfg-vk.dpkg - path: | - *.deb - - name: Upload lsfg-vk for rpm - uses: actions/upload-artifact@v4 - with: - name: lsfg-vk.rpm - path: | - *.rpm - - name: Upload lsfg-vk for alpm - uses: actions/upload-artifact@v4 - with: - name: lsfg-vk.alpm - path: | - *.zst diff --git a/.github/workflows/build_test.yml b/.github/workflows/test.yml similarity index 54% rename from .github/workflows/build_test.yml rename to .github/workflows/test.yml index bcc1296..d46b17e 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/test.yml @@ -1,16 +1,34 @@ name: (Manual) Build lsfg-vk -on: ["workflow_dispatch"] +on: + issue_comment: + types: ["created"] + +permissions: + pull-requests: write jobs: build: runs-on: ubuntu-latest + if: | + github.event.issue.pull_request && + github.event.comment.body == '@actions build' && + github.event.comment.user.login == 'PancakeTAS' steps: # prepare system + - name: Find commit hash + id: prRef + run: | + echo "ref=$(gh pr view $PR_NUMBER --repo ${{ github.repository }} --json headRefName \ + | jq -r '.headRefName')" >> $GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.issue.number }} - name: Checkout repository uses: actions/checkout@v4 with: - submodules: true + ref: ${{ steps.prRef.outputs.ref }} + fetch-depth: 0 - name: Install build dependencies uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -28,17 +46,16 @@ jobs: - name: Configure with CMake and Ninja run: | cmake -B build -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=./target \ -DCMAKE_C_COMPILER=clang \ - -DCMAKE_CXX_COMPILER=clang++ \ - -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=On + -DCMAKE_CXX_COMPILER=clang++ - name: Build with Ninja run: | ninja -C build - name: Install with CMake run: | - cmake --install build --strip + cmake --install build - name: Build lsfg-vk-ui run: | pushd ui @@ -51,6 +68,12 @@ jobs: mv ui/lsfg-vk-ui.AppImage target/bin/lsfg-vk-ui cp ui/rsc/gay.pancake.lsfg-vk-ui.desktop target/share/applications/lsfg-vk-ui.desktop cp ui/rsc/icon.png target/share/icons/hicolor/256x256/apps/gay.pancake.lsfg-vk-ui.png + # create packages for various distros + - name: Package lsfg-vk for various distros + run: | + cp -rv target/* . + chmod +x ./package/package.sh + ./package/package.sh # upload all files - name: Upload lsfg-vk artifact uses: actions/upload-artifact@v4 @@ -69,3 +92,31 @@ jobs: path: | target/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json target/lib/liblsfg-vk.so + - name: Upload lsfg-vk for dpkg + uses: actions/upload-artifact@v4 + with: + name: lsfg-vk.dpkg + path: | + *.deb + - name: Upload lsfg-vk for rpm + uses: actions/upload-artifact@v4 + with: + name: lsfg-vk.rpm + path: | + *.rpm + - name: Upload lsfg-vk for alpm + uses: actions/upload-artifact@v4 + with: + name: lsfg-vk.alpm + path: | + *.zst + # comment on pull request + - name: Comment on PR + uses: thollander/actions-comment-pull-request@v3 + with: + pr-number: ${{ github.event.issue.number }} + message: | + **Development Build** + + I have built this lsfg-vk pull request for you: + https://github.com/PancakeTAS/lsfg-vk/actions/runs/${{ github.run_id }} diff --git a/src/config/config.cpp b/src/config/config.cpp index b4406e6..d976e70 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -132,8 +132,9 @@ void Config::updateConfig( } if (!gameConf.has_value()) { + if (Config::currentConf.has_value()) // print log message only if previously enabled + std::cerr << "lsfg-vk: Configuration entry disappeared, disabling.\n"; Config::currentConf.reset(); - std::cerr << "lsfg-vk: Configuration entry disappeared, disabling.\n"; return; }