Fix AppImage build #36
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| env: | |
| VULKAN_SDK_VERSION: 1.4.341.1 | |
| VULKAN_SDK_WINDOWS_SHA256: bcf2d75aa9556889ab974858666e20b3655b6055a0db704ccb47279ff33b5bfe | |
| VULKAN_SDK_LINUX_SHA256: 17c8b7e872d8038fbd4e1239aa8483b495f862ad16b1c58644f7ecd8041d20cc | |
| APPIMAGETOOL_VERSION: 1.9.0 | |
| APPIMAGETOOL_SHA256: 46fdd785094c7f6e545b61afcfb0f3d98d8eab243f644b4b17698c01d06083d1 | |
| jobs: | |
| build-windows: | |
| name: Windows Release | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Setup MSVC | |
| uses: ilammy/msvc-dev-cmd@v1.13.0 | |
| - name: Cache Vulkan SDK | |
| id: vulkan-cache-windows | |
| uses: actions/cache@v5 | |
| with: | |
| path: VULKAN_SDK | |
| key: ${{ runner.os }}-vulkan-${{ env.VULKAN_SDK_VERSION }} | |
| - name: Install Vulkan SDK | |
| if: steps.vulkan-cache-windows.outputs.cache-hit != 'true' | |
| shell: pwsh | |
| run: | | |
| $version = '${{ env.VULKAN_SDK_VERSION }}' | |
| $expectedHash = '${{ env.VULKAN_SDK_WINDOWS_SHA256 }}' | |
| $sdkDir = Join-Path $PWD 'VULKAN_SDK' | |
| $installer = Join-Path $PWD 'vulkan_sdk.exe' | |
| Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$version/windows/vulkan_sdk.exe?Human=true" -OutFile $installer | |
| $actualHash = (Get-FileHash $installer -Algorithm SHA256).Hash.ToLower() | |
| if ($actualHash -ne $expectedHash) { | |
| throw "Vulkan SDK hash mismatch: expected $expectedHash, got $actualHash" | |
| } | |
| Start-Process -FilePath $installer -ArgumentList @('--root', $sdkDir, '--accept-licenses', '--default-answer', '--confirm-command', 'install', 'copy_only=1') -Wait -NoNewWindow | |
| - name: Set Vulkan SDK Environment | |
| shell: pwsh | |
| run: | | |
| $sdkDir = Join-Path $PWD 'VULKAN_SDK' | |
| "VULKAN_SDK=$sdkDir" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
| "VK_SDK_PATH=$sdkDir" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
| (Join-Path $sdkDir 'Bin') | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8 | |
| - name: Install Meson and Ninja | |
| run: python -m pip install meson ninja | |
| - name: Configure | |
| run: meson setup build --buildtype=release -Db_vscrt=static_from_buildtype -Dvkrt_version='${{ github.ref_name }}' | |
| - name: Build | |
| run: meson compile -C build | |
| - name: Test | |
| run: ./build/vkrt.exe --help && ./build/vkrt.exe --version | |
| shell: bash | |
| - name: Stage Release | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path vkrt-windows-x64 | Out-Null | |
| Copy-Item build\vkrt.exe vkrt-windows-x64 | |
| Copy-Item -Recurse assets vkrt-windows-x64 | |
| Copy-Item README.md vkrt-windows-x64 | |
| Compress-Archive -Path vkrt-windows-x64\* -DestinationPath vkrt-windows-x64.zip -Force | |
| - name: Upload Release Asset | |
| if: github.ref_type == 'tag' | |
| uses: softprops/action-gh-release@v2.6.1 | |
| with: | |
| files: vkrt-windows-x64.zip | |
| - name: Upload Workflow Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: vkrt-windows-x64 | |
| path: vkrt-windows-x64.zip | |
| build-linux: | |
| name: Linux Release | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Cache Vulkan SDK | |
| id: vulkan-cache-linux | |
| uses: actions/cache@v5 | |
| with: | |
| path: VULKAN_SDK | |
| key: ${{ runner.os }}-vulkan-${{ env.VULKAN_SDK_VERSION }} | |
| - name: Install Vulkan SDK | |
| if: steps.vulkan-cache-linux.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| curl -fsSL "https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_SDK_VERSION }}/linux/vulkan_sdk.tar.xz?Human=true" -o vulkan_sdk.tar.xz | |
| echo "${{ env.VULKAN_SDK_LINUX_SHA256 }} vulkan_sdk.tar.xz" | sha256sum -c - | |
| tar -xJf vulkan_sdk.tar.xz | |
| mkdir -p VULKAN_SDK | |
| cp -a "${{ env.VULKAN_SDK_VERSION }}/x86_64/." VULKAN_SDK/ | |
| - name: Set Vulkan SDK Environment | |
| shell: bash | |
| run: | | |
| echo "VULKAN_SDK=$PWD/VULKAN_SDK" >> "$GITHUB_ENV" | |
| echo "$PWD/VULKAN_SDK/bin" >> "$GITHUB_PATH" | |
| - name: Install Linux Packages | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libdbus-1-dev pkg-config libfuse2 desktop-file-utils libwayland-dev libxkbcommon-dev wayland-protocols libx11-dev libxrandr-dev libxinerama-dev libxi-dev libxcursor-dev libxext-dev | |
| - name: Install Meson and Ninja | |
| run: python -m pip install meson ninja | |
| - name: Configure | |
| run: meson setup build --buildtype=release -Dlinux_window_backend=both -Dnfd_backend=portal -Dvkrt_version='${{ github.ref_name }}' | |
| - name: Build | |
| run: meson compile -C build | |
| - name: Test | |
| run: ./build/vkrt --help && ./build/vkrt --version | |
| - name: Package Linux Release | |
| env: | |
| APPIMAGETOOL_VERSION: ${{ env.APPIMAGETOOL_VERSION }} | |
| APPIMAGETOOL_SHA256: ${{ env.APPIMAGETOOL_SHA256 }} | |
| run: | | |
| python scripts/build_appimage.py --appimage | |
| - name: Test Packaged Linux Bundle | |
| run: ./vkrt-linux-x64/vkrt --help && ./vkrt-linux-x64/vkrt --version | |
| - name: Upload Release Assets | |
| if: github.ref_type == 'tag' | |
| uses: softprops/action-gh-release@v2.6.1 | |
| with: | |
| files: | | |
| vkrt-linux-x64.tar.gz | |
| vkrt-linux-x86_64.AppImage | |
| - name: Upload Workflow Artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: vkrt-linux-x64 | |
| path: | | |
| vkrt-linux-x64.tar.gz | |
| vkrt-linux-x86_64.AppImage |