Redesign GitHub Pages landing to look trustworthy #24
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: Build KytyPS5 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Visual Studio environment | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Setup Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@v5 | |
| # vcpkg glslang[tools,opt] compiles from source and routinely hangs/times out | |
| # on windows-2022 (10+ minutes on a good day, multi-hour stalls observed). | |
| # Pull a prebuilt glslangValidator from the Vulkan SDK instead (cached). | |
| - name: Install glslangValidator (Vulkan SDK) | |
| uses: jakoch/install-vulkan-sdk-action@v1.6.0 | |
| with: | |
| vulkan_version: 1.4.350.0 | |
| cache: true | |
| stripdown: true | |
| install_runtime: false | |
| - name: Install Qt 6.10.3 | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: "6.10.3" | |
| host: windows | |
| target: desktop | |
| arch: win64_msvc2022_64 | |
| cache: true | |
| - name: Verify toolchain | |
| shell: cmd | |
| run: | | |
| git --version | |
| cmake --version | |
| ninja --version | |
| clang-cl --version | |
| glslangValidator --version | |
| echo Qt6_DIR=%Qt6_DIR% | |
| - name: Configure | |
| shell: pwsh | |
| run: | | |
| cmake -S src -B _Build/windows ` | |
| -G Ninja ` | |
| -DCMAKE_BUILD_TYPE=Release ` | |
| -DCMAKE_C_COMPILER=clang-cl ` | |
| -DCMAKE_CXX_COMPILER=clang-cl ` | |
| "-DCMAKE_PREFIX_PATH=$env:Qt6_DIR" 2>&1 | Tee-Object configure.log | |
| $code = $LASTEXITCODE | |
| if ($code -ne 0) { | |
| # Surface the failure in the run summary so it is visible without log access. | |
| "### Configure failed (exit $code)" | Out-File $env:GITHUB_STEP_SUMMARY -Append | |
| '```' | Out-File $env:GITHUB_STEP_SUMMARY -Append | |
| Get-Content configure.log -Tail 150 | Out-File $env:GITHUB_STEP_SUMMARY -Append | |
| '```' | Out-File $env:GITHUB_STEP_SUMMARY -Append | |
| foreach ($f in @('CMakeError.log', 'CMakeConfigureLog.yaml')) { | |
| $p = "_Build/windows/CMakeFiles/$f" | |
| if (Test-Path $p) { | |
| "### $f (tail)" | Out-File $env:GITHUB_STEP_SUMMARY -Append | |
| '```' | Out-File $env:GITHUB_STEP_SUMMARY -Append | |
| Get-Content $p -Tail 100 | Out-File $env:GITHUB_STEP_SUMMARY -Append | |
| '```' | Out-File $env:GITHUB_STEP_SUMMARY -Append | |
| } | |
| } | |
| } | |
| exit $code | |
| - name: Build | |
| shell: cmd | |
| run: | | |
| cmake --build _Build/windows --target launcher --parallel | |
| - name: Install | |
| shell: cmd | |
| run: | | |
| cmake --install _Build/windows --prefix _Build/windows/install | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: KytyPS5 | |
| path: _Build/windows/install/** | |
| if-no-files-found: error | |
| release: | |
| if: github.event_name == 'push' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: KytyPS5 | |
| path: KytyPS5 | |
| - name: Set release name | |
| shell: bash | |
| run: | | |
| echo "RELEASE_NAME=KytyPS5-$(date -u +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_ENV" | |
| - name: Package build | |
| shell: bash | |
| run: zip -r "$RELEASE_NAME.zip" KytyPS5 | |
| - name: Create release | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if gh release view "$RELEASE_NAME" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then | |
| gh release upload "$RELEASE_NAME" "$RELEASE_NAME.zip" --clobber --repo "$GITHUB_REPOSITORY" | |
| else | |
| gh release create "$RELEASE_NAME" "$RELEASE_NAME.zip" \ | |
| --generate-notes \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --target "$GITHUB_SHA" \ | |
| --title "$RELEASE_NAME" | |
| fi |