workflows: better manual dispatch

This commit is contained in:
PancakeTAS 2025-08-29 12:22:22 +02:00
parent 714326ce11
commit 8b87a0c71b
No known key found for this signature in database
6 changed files with 59 additions and 97 deletions

View file

@ -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:

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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 }}

View file

@ -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;
}