diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 0000000..bcc1296 --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,71 @@ +name: (Manual) Build lsfg-vk + +on: ["workflow_dispatch"] + +jobs: + build: + runs-on: ubuntu-latest + steps: + # prepare system + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + - name: Install build dependencies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: git wget xvfb + clang clang-tools llvm rustup + cmake ninja-build pkg-config + libdecor-0-0 libvulkan-dev + libgtk-4-dev libadwaita-1-dev + version: 1.0 + execute_install_scripts: true + - name: Install rust dependency + run: | + rustup default stable + # build the project + - name: Configure with CMake and Ninja + run: | + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=./target \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=On + - name: Build with Ninja + run: | + ninja -C build + - name: Install with CMake + run: | + cmake --install build --strip + - name: Build lsfg-vk-ui + run: | + pushd ui + chmod +x ./build_appimage.sh + ./build_appimage.sh + popd + - name: Install lsfg-vk-ui + run: | + mkdir -p target/{bin,share/applications,share/icons/hicolor/256x256/apps} + 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 + # upload all files + - name: Upload lsfg-vk artifact + uses: actions/upload-artifact@v4 + with: + name: lsfg-vk + path: | + target/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json + target/share/applications/lsfg-vk-ui.desktop + target/share/icons/hicolor/256x256/apps/gay.pancake.lsfg-vk-ui.png + target/lib/liblsfg-vk.so + target/bin/lsfg-vk-ui + - name: Upload lsfg-vk artifact (without UI) + uses: actions/upload-artifact@v4 + with: + name: lsfg-vk_noui + path: | + target/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json + target/lib/liblsfg-vk.so diff --git a/.github/workflows/flatpak_test.yml b/.github/workflows/flatpak_test.yml new file mode 100644 index 0000000..cdeb271 --- /dev/null +++ b/.github/workflows/flatpak_test.yml @@ -0,0 +1,38 @@ +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 new file mode 100644 index 0000000..aa7a671 --- /dev/null +++ b/.github/workflows/package_test.yml @@ -0,0 +1,45 @@ +name: (Manual) Package lsfg-vk + +on: + workflow_run: + workflows: ["(Manual) Build lsfg-vk"] + types: + - completed + +jobs: + package: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + # prepare system + - name: Checkout repository + uses: actions/checkout@v4 + - 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