mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-08-03 11:23:49 +00:00
* ci: add macOS build workflow * macos: add POSIX compatibility guards * ci: select Xcode 26 for macOS * macos: add kernel POSIX compatibility * launcher: support macOS process startup * ci: fix macOS architecture verification * ci: cache glslang on Windows --------- Co-authored-by: Abdullah K. <akjee204@gmail.com>
136 lines
3.8 KiB
YAML
136 lines
3.8 KiB
YAML
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
|
|
|
|
- name: Locate vcpkg
|
|
id: vcpkg
|
|
shell: pwsh
|
|
run: |
|
|
$vcpkgRoot = Split-Path (Get-Command vcpkg).Source
|
|
$portHash = (Get-FileHash "$vcpkgRoot\ports\glslang\vcpkg.json" -Algorithm SHA256).Hash
|
|
"root=$vcpkgRoot" |
|
|
Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
|
"port_hash=$($portHash.ToLowerInvariant())" |
|
|
Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
|
|
|
- name: Cache glslang
|
|
id: glslang_cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.vcpkg.outputs.root }}\installed\x64-windows
|
|
key: glslang-${{ runner.os }}-${{ runner.arch }}-${{ steps.vcpkg.outputs.port_hash }}-tools-opt
|
|
|
|
- name: Install glslang
|
|
shell: pwsh
|
|
run: |
|
|
$vcpkgRoot = "${{ steps.vcpkg.outputs.root }}"
|
|
if ("${{ steps.glslang_cache.outputs.cache-hit }}" -ne "true") {
|
|
vcpkg install glslang[tools,opt]:x64-windows
|
|
}
|
|
"$vcpkgRoot\installed\x64-windows\tools\glslang" |
|
|
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
|
|
- 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: cmd
|
|
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="%Qt6_DIR%"
|
|
|
|
- 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
|